[jira] [Closed] (FOP-2512) java.lang.NullPointerException: Parameter alpha must not be null

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner closed FOP-2512.
--
Resolution: Fixed

> java.lang.NullPointerException: Parameter alpha must not be null
> 
>
> Key: FOP-2512
> URL: https://issues.apache.org/jira/browse/FOP-2512
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Mathieu Malaterre
> Attachments: 16x16.png, 19x13.png, 22x22.png
>
>
> fop is not capable of dealing with some PNG, it keeps on failing with:
> Error while rendering page 9
> java.lang.NullPointerException: Parameter alpha must not be null
> Exception
> java.lang.NullPointerException: Parameter alpha must not be null
> Input is:
> $ pnginfo test.png
> test.png...
>   Image Width: 411 Image Length: 225
>   Bitdepth (Bits/Sample): 8
>   Channels (Samples/Pixel): 1
>   Pixel depth (Pixel Depth): 8
>   Colour Type (Photometric Interpretation): PALETTED COLOUR with alpha (18 
> colours, 17 transparent) 
>   Image filter: Single row per byte filter 
>   Interlacing: No interlacing 
>   Compression Scheme: Deflate method 8, 32k window
>   Resolution: 0, 0 (unit unknown)
>   FillOrder: msb-to-lsb
>   Byte Order: Network (Big Endian)
>   Number of text strings: 0 of 0



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2512) java.lang.NullPointerException: Parameter alpha must not be null

2015-12-18 Thread Matthias Reischenbacher (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064235#comment-15064235
 ] 

Matthias Reischenbacher commented on FOP-2512:
--

Yes. I can't, because I don't seem to have the right to do so.

> java.lang.NullPointerException: Parameter alpha must not be null
> 
>
> Key: FOP-2512
> URL: https://issues.apache.org/jira/browse/FOP-2512
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Mathieu Malaterre
> Attachments: 16x16.png, 19x13.png, 22x22.png
>
>
> fop is not capable of dealing with some PNG, it keeps on failing with:
> Error while rendering page 9
> java.lang.NullPointerException: Parameter alpha must not be null
> Exception
> java.lang.NullPointerException: Parameter alpha must not be null
> Input is:
> $ pnginfo test.png
> test.png...
>   Image Width: 411 Image Length: 225
>   Bitdepth (Bits/Sample): 8
>   Channels (Samples/Pixel): 1
>   Pixel depth (Pixel Depth): 8
>   Colour Type (Photometric Interpretation): PALETTED COLOUR with alpha (18 
> colours, 17 transparent) 
>   Image filter: Single row per byte filter 
>   Interlacing: No interlacing 
>   Compression Scheme: Deflate method 8, 32k window
>   Resolution: 0, 0 (unit unknown)
>   FillOrder: msb-to-lsb
>   Byte Order: Network (Big Endian)
>   Number of text strings: 0 of 0



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (FOP-2532) FontCache throws java.lang.IllegalArgumentException: URI scheme is not "file" for jar embedded fonts

2015-12-18 Thread JIRA

[ 
https://issues.apache.org/jira/browse/FOP-2532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064151#comment-15064151
 ] 

Martin Hönings edited comment on FOP-2532 at 12/18/15 4:21 PM:
---

I don't want to disable font caching!

Because of the bug the font caching does not work for JARs.

My proposed bugfix will make font caching for fonts in JARs working, as I want 
it.


was (Author: martinx):
I don't want to disable font caching!

Because of the bug the font caching does not work for JARs.

> FontCache throws java.lang.IllegalArgumentException: URI scheme is not "file" 
> for jar embedded fonts
> 
>
> Key: FOP-2532
> URL: https://issues.apache.org/jira/browse/FOP-2532
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Brian Preuß
> Attachments: lastModified-value-on-opaque-URI.patch
>
>
> If using  fop finds fonts embedded in jar files (via 
> MANIFEST.MF entries as described at 
> http://xmlgraphics.apache.org/fop/2.0/fonts.html#autodetect) and tries to add 
> them to the font cache. This throws the following exception:
> {code}
> java.lang.IllegalArgumentException: URI scheme is not "file"
> 26677/0|  at java.io.File.(File.java:421)
> 26677/0|  at org.apache.fop.fonts.FontCache.addFont(FontCache.java:335)
> 26677/0|  at 
> org.apache.fop.fonts.autodetect.FontInfoFinder.getFontInfoFromCustomFont(FontInfoFinder.java:157)
> 26677/0|  at 
> org.apache.fop.fonts.autodetect.FontInfoFinder.find(FontInfoFinder.java:269)
> 26677/0|  at org.apache.fop.fonts.FontAdder.add(FontAdder.java:63)
> 26677/0|  at 
> org.apache.fop.fonts.FontDetectorFactory$DefaultFontDetector.detect(FontDetectorFactory.java:110)
> 26677/0|  at 
> org.apache.fop.fonts.FontManager.autoDetectFonts(FontManager.java:229)
> 26677/0|  at 
> org.apache.fop.fonts.DefaultFontConfigurator.configure(DefaultFontConfigurator.java:82)
> 26677/0|  at 
> org.apache.fop.render.PrintRendererConfigurator.getCustomFontCollection(PrintRendererConfigurator.java:147)
> 26677/0|  at 
> org.apache.fop.render.PrintRendererConfigurator.setupFontInfo(PrintRendererConfigurator.java:127)
> 26677/0|  at 
> org.apache.fop.render.intermediate.IFUtil.setupFonts(IFUtil.java:170)
> 26677/0|  at 
> org.apache.fop.render.intermediate.IFRenderer.setupFontInfo(IFRenderer.java:187)
> 26677/0|  at 
> org.apache.fop.area.RenderPagesModel.(RenderPagesModel.java:75)
> 26677/0|  at 
> org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:135)
> 26677/0|  at 
> org.apache.fop.area.AreaTreeHandler.(AreaTreeHandler.java:105)
> 26677/0|  at 
> org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:350)
> 26677/0|  at 
> org.apache.fop.fo.FOTreeBuilder.(FOTreeBuilder.java:107)
> 26677/0|  at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:104)
> 26677/0|  at org.apache.fop.apps.Fop.(Fop.java:78)
> 26677/0|  at org.apache.fop.apps.FOUserAgent.newFop(FOUserAgent.java:179)
> 26677/0|  at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:240)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2532) FontCache throws java.lang.IllegalArgumentException: URI scheme is not "file" for jar embedded fonts

2015-12-18 Thread JIRA

[ 
https://issues.apache.org/jira/browse/FOP-2532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064151#comment-15064151
 ] 

Martin Hönings commented on FOP-2532:
-

I don't want to disable font caching!

Because of the bug the font caching does not work for JARs.

> FontCache throws java.lang.IllegalArgumentException: URI scheme is not "file" 
> for jar embedded fonts
> 
>
> Key: FOP-2532
> URL: https://issues.apache.org/jira/browse/FOP-2532
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Brian Preuß
> Attachments: lastModified-value-on-opaque-URI.patch
>
>
> If using  fop finds fonts embedded in jar files (via 
> MANIFEST.MF entries as described at 
> http://xmlgraphics.apache.org/fop/2.0/fonts.html#autodetect) and tries to add 
> them to the font cache. This throws the following exception:
> {code}
> java.lang.IllegalArgumentException: URI scheme is not "file"
> 26677/0|  at java.io.File.(File.java:421)
> 26677/0|  at org.apache.fop.fonts.FontCache.addFont(FontCache.java:335)
> 26677/0|  at 
> org.apache.fop.fonts.autodetect.FontInfoFinder.getFontInfoFromCustomFont(FontInfoFinder.java:157)
> 26677/0|  at 
> org.apache.fop.fonts.autodetect.FontInfoFinder.find(FontInfoFinder.java:269)
> 26677/0|  at org.apache.fop.fonts.FontAdder.add(FontAdder.java:63)
> 26677/0|  at 
> org.apache.fop.fonts.FontDetectorFactory$DefaultFontDetector.detect(FontDetectorFactory.java:110)
> 26677/0|  at 
> org.apache.fop.fonts.FontManager.autoDetectFonts(FontManager.java:229)
> 26677/0|  at 
> org.apache.fop.fonts.DefaultFontConfigurator.configure(DefaultFontConfigurator.java:82)
> 26677/0|  at 
> org.apache.fop.render.PrintRendererConfigurator.getCustomFontCollection(PrintRendererConfigurator.java:147)
> 26677/0|  at 
> org.apache.fop.render.PrintRendererConfigurator.setupFontInfo(PrintRendererConfigurator.java:127)
> 26677/0|  at 
> org.apache.fop.render.intermediate.IFUtil.setupFonts(IFUtil.java:170)
> 26677/0|  at 
> org.apache.fop.render.intermediate.IFRenderer.setupFontInfo(IFRenderer.java:187)
> 26677/0|  at 
> org.apache.fop.area.RenderPagesModel.(RenderPagesModel.java:75)
> 26677/0|  at 
> org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:135)
> 26677/0|  at 
> org.apache.fop.area.AreaTreeHandler.(AreaTreeHandler.java:105)
> 26677/0|  at 
> org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:350)
> 26677/0|  at 
> org.apache.fop.fo.FOTreeBuilder.(FOTreeBuilder.java:107)
> 26677/0|  at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:104)
> 26677/0|  at org.apache.fop.apps.Fop.(Fop.java:78)
> 26677/0|  at org.apache.fop.apps.FOUserAgent.newFop(FOUserAgent.java:179)
> 26677/0|  at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:240)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (FOP-2554) FopConfig permits file URI for fonts only

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2554?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner closed FOP-2554.
--
Resolution: Duplicate

> FopConfig permits file URI for fonts only
> -
>
> Key: FOP-2554
> URL: https://issues.apache.org/jira/browse/FOP-2554
> Project: FOP
>  Issue Type: Bug
>  Components: font/unqualified
>Affects Versions: 2.0
> Environment: all flatforms
>Reporter: Mr. Povarnitsyn
>Priority: Minor
>  Labels: font, uri
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> config has following:
>   
>  embed-url="classpath:///fonts/arialuni.ttf">
>   
> 
> Exception on FontCache.java (line 335)
> File fontFile = new File(fontUri);
> My proposal:
> Instead:
> File fontFile = new File(fontUri);
> long lastModified = fontFile.lastModified();
> cachedFontFile = new CachedFontFile(lastModified);
> Write:
>   long lastModified = 0L;
>   if(fontUri.getScheme().equals("file")){
>   File fontFile = new File(fontUri);
>   lastModified = fontFile.lastModified(); 
>   }
> cachedFontFile = new CachedFontFile(lastModified);
> This code is working.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2532) FontCache throws java.lang.IllegalArgumentException: URI scheme is not "file" for jar embedded fonts

2015-12-18 Thread simon steiner (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064147#comment-15064147
 ] 

simon steiner commented on FOP-2532:


You can disable font caching using 
EnvironmentalProfileFactory.createRestrictedIO and therefore no need to modify 
fop.

> FontCache throws java.lang.IllegalArgumentException: URI scheme is not "file" 
> for jar embedded fonts
> 
>
> Key: FOP-2532
> URL: https://issues.apache.org/jira/browse/FOP-2532
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Brian Preuß
> Attachments: lastModified-value-on-opaque-URI.patch
>
>
> If using  fop finds fonts embedded in jar files (via 
> MANIFEST.MF entries as described at 
> http://xmlgraphics.apache.org/fop/2.0/fonts.html#autodetect) and tries to add 
> them to the font cache. This throws the following exception:
> {code}
> java.lang.IllegalArgumentException: URI scheme is not "file"
> 26677/0|  at java.io.File.(File.java:421)
> 26677/0|  at org.apache.fop.fonts.FontCache.addFont(FontCache.java:335)
> 26677/0|  at 
> org.apache.fop.fonts.autodetect.FontInfoFinder.getFontInfoFromCustomFont(FontInfoFinder.java:157)
> 26677/0|  at 
> org.apache.fop.fonts.autodetect.FontInfoFinder.find(FontInfoFinder.java:269)
> 26677/0|  at org.apache.fop.fonts.FontAdder.add(FontAdder.java:63)
> 26677/0|  at 
> org.apache.fop.fonts.FontDetectorFactory$DefaultFontDetector.detect(FontDetectorFactory.java:110)
> 26677/0|  at 
> org.apache.fop.fonts.FontManager.autoDetectFonts(FontManager.java:229)
> 26677/0|  at 
> org.apache.fop.fonts.DefaultFontConfigurator.configure(DefaultFontConfigurator.java:82)
> 26677/0|  at 
> org.apache.fop.render.PrintRendererConfigurator.getCustomFontCollection(PrintRendererConfigurator.java:147)
> 26677/0|  at 
> org.apache.fop.render.PrintRendererConfigurator.setupFontInfo(PrintRendererConfigurator.java:127)
> 26677/0|  at 
> org.apache.fop.render.intermediate.IFUtil.setupFonts(IFUtil.java:170)
> 26677/0|  at 
> org.apache.fop.render.intermediate.IFRenderer.setupFontInfo(IFRenderer.java:187)
> 26677/0|  at 
> org.apache.fop.area.RenderPagesModel.(RenderPagesModel.java:75)
> 26677/0|  at 
> org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:135)
> 26677/0|  at 
> org.apache.fop.area.AreaTreeHandler.(AreaTreeHandler.java:105)
> 26677/0|  at 
> org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:350)
> 26677/0|  at 
> org.apache.fop.fo.FOTreeBuilder.(FOTreeBuilder.java:107)
> 26677/0|  at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:104)
> 26677/0|  at org.apache.fop.apps.Fop.(Fop.java:78)
> 26677/0|  at org.apache.fop.apps.FOUserAgent.newFop(FOUserAgent.java:179)
> 26677/0|  at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:240)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (FOP-2532) FontCache throws java.lang.IllegalArgumentException: URI scheme is not "file" for jar embedded fonts

2015-12-18 Thread JIRA

[ 
https://issues.apache.org/jira/browse/FOP-2532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064133#comment-15064133
 ] 

Martin Hönings edited comment on FOP-2532 at 12/18/15 4:01 PM:
---

Why not using the method:

public static long getLastModified(URI uri)

which I already proposed before and which is already defined in the class 
FontCache?
This method works correctly and is already used, when fonts are removed from 
cache.
If you use two different methods with different results for lastModification 
calculation during adding and removing fonts, this will not work correktly for 
JARs.
Neither the patch proposed here nor in 
https://issues.apache.org/jira/browse/FOP-2554 works correktly.
The result is the following:

[TRACE ] [http-apr-8080-exec-1] [2015-12-18 16:39:40,821] [Font removed from 
cache: 
jar:file:/D:/apache-tomcat-8.0.28/webapps/XXX/WEB-INF/lib/yyy.jar!/fonts/arialuni.ttf]
 [org.apache.fop.fonts.FontCache] 
[TRACE ] [http-apr-8080-exec-1] [2015-12-18 16:39:41,021] [Font added to cache: 
jar:file:/D:/apache-tomcat-8.0.28/webapps/XXX/WEB-INF/lib/yyy.jar!/fonts/arialuni.ttf]
 [org.apache.fop.fonts.FontCache]

The fonts are always removed and then added again. So the FontCache is not 
really a cache any more.

The lastModification calculation during remove executes the following code:
FontInfoFinder from line 179:
fileLastModified = FontCache.getLastModified(fontURI);
// firstly try and fetch it from cache before loading/parsing the 
font file
if (fontCache.containsFont(embedStr)) {
EmbedFontInfo[] fontInfos = fontCache.getFontInfos(embedStr, 
fileLastModified);
FontCache from line 384:
public EmbedFontInfo[] getFontInfos(String embedUrl, long lastModified) {
CachedFontFile cff = getFontFile(embedUrl);
if (cff.lastModified() == lastModified) {
return cff.getEmbedFontInfos();
} else {
removeFont(embedUrl);

You can see here the usage of the method getLastModified during font removal.
The lastModified calculated there is compared with the lastModified before 
adding a font. Since the calculation is done in two different ways with two 
different results, the font is always removed.

So simply use the working method
public static long getLastModified(URI uri) fom class FontCache
everywhere. The correction must be:

In the class "FontCache" in the method "addFont" replace:
File fontFile = new File(fontUri);
long lastModified = fontFile.lastModified();
with:
long lastModified = getLastModified(fontUri);

That works.




was (Author: martinx):
Why not using the method:

public static long getLastModified(URI uri)

which I already proposed before and which is already defined in the class 
FontCache?
This method works correctly and is already used, when fonts are removed from 
cache.
If you use two different methods with different results for lastModification 
calculation during adding and removing fonts, this will not work correktly for 
JARs.
Neither the patch proposed here nor in 
https://issues.apache.org/jira/browse/FOP-2554 works correktly.
The result is the following:

[TRACE ] [http-apr-8080-exec-1] [2015-12-18 16:39:40,821] [Font removed from 
cache: 
jar:file:/D:/apache-tomcat-8.0.28/webapps/XXX/WEB-INF/lib/yyy-3.8.0.0.jar!/fonts/arialuni.ttf]
 [org.apache.fop.fonts.FontCache] 
[TRACE ] [http-apr-8080-exec-1] [2015-12-18 16:39:41,021] [Font added to cache: 
jar:file:/D:/apache-tomcat-8.0.28/webapps/XXX/WEB-INF/lib/yyy-3.8.0.0.jar!/fonts/arialuni.ttf]
 [org.apache.fop.fonts.FontCache]

The fonts are always removed and then added again. So the FontCache is not 
really a cache any more.

The lastModification calculation during remove executes the following code:
FontInfoFinder from line 179:
fileLastModified = FontCache.getLastModified(fontURI);
// firstly try and fetch it from cache before loading/parsing the 
font file
if (fontCache.containsFont(embedStr)) {
EmbedFontInfo[] fontInfos = fontCache.getFontInfos(embedStr, 
fileLastModified);
FontCache from line 384:
public EmbedFontInfo[] getFontInfos(String embedUrl, long lastModified) {
CachedFontFile cff = getFontFile(embedUrl);
if (cff.lastModified() == lastModified) {
return cff.getEmbedFontInfos();
} else {
removeFont(embedUrl);

You can see here the usage of the method getLastModified during font removal.
The lastModified calculated there is compared with the lastModified before 
adding a font. Since the calculation is done in two different ways with two 
different results, the font is always removed.

So simply use the working method
public static long getLastModified(URI uri) fom class FontCache
everywhere. The correction must be:

In the class "FontCache" in the method "addFont" replace:
File fontFile = new File(fontUri);
l

[jira] [Commented] (FOP-2554) FopConfig permits file URI for fonts only

2015-12-18 Thread JIRA

[ 
https://issues.apache.org/jira/browse/FOP-2554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064135#comment-15064135
 ] 

Martin Hönings commented on FOP-2554:
-

See https://issues.apache.org/jira/browse/FOP-2532 for a correct solution.

> FopConfig permits file URI for fonts only
> -
>
> Key: FOP-2554
> URL: https://issues.apache.org/jira/browse/FOP-2554
> Project: FOP
>  Issue Type: Bug
>  Components: font/unqualified
>Affects Versions: 2.0
> Environment: all flatforms
>Reporter: Mr. Povarnitsyn
>Priority: Minor
>  Labels: font, uri
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> config has following:
>   
>  embed-url="classpath:///fonts/arialuni.ttf">
>   
> 
> Exception on FontCache.java (line 335)
> File fontFile = new File(fontUri);
> My proposal:
> Instead:
> File fontFile = new File(fontUri);
> long lastModified = fontFile.lastModified();
> cachedFontFile = new CachedFontFile(lastModified);
> Write:
>   long lastModified = 0L;
>   if(fontUri.getScheme().equals("file")){
>   File fontFile = new File(fontUri);
>   lastModified = fontFile.lastModified(); 
>   }
> cachedFontFile = new CachedFontFile(lastModified);
> This code is working.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2532) FontCache throws java.lang.IllegalArgumentException: URI scheme is not "file" for jar embedded fonts

2015-12-18 Thread JIRA

[ 
https://issues.apache.org/jira/browse/FOP-2532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064133#comment-15064133
 ] 

Martin Hönings commented on FOP-2532:
-

Why not using the method:

public static long getLastModified(URI uri)

which I already proposed before and which is already defined in the class 
FontCache?
This method works correctly and is already used, when fonts are removed from 
cache.
If you use two different methods with different results for lastModification 
calculation during adding and removing fonts, this will not work correktly for 
JARs.
Neither the patch proposed here nor in 
https://issues.apache.org/jira/browse/FOP-2554 works correktly.
The result is the following:

[TRACE ] [http-apr-8080-exec-1] [2015-12-18 16:39:40,821] [Font removed from 
cache: 
jar:file:/D:/apache-tomcat-8.0.28/webapps/XXX/WEB-INF/lib/yyy-3.8.0.0.jar!/fonts/arialuni.ttf]
 [org.apache.fop.fonts.FontCache] 
[TRACE ] [http-apr-8080-exec-1] [2015-12-18 16:39:41,021] [Font added to cache: 
jar:file:/D:/apache-tomcat-8.0.28/webapps/XXX/WEB-INF/lib/yyy-3.8.0.0.jar!/fonts/arialuni.ttf]
 [org.apache.fop.fonts.FontCache]

The fonts are always removed and then added again. So the FontCache is not 
really a cache any more.

The lastModification calculation during remove executes the following code:
FontInfoFinder from line 179:
fileLastModified = FontCache.getLastModified(fontURI);
// firstly try and fetch it from cache before loading/parsing the 
font file
if (fontCache.containsFont(embedStr)) {
EmbedFontInfo[] fontInfos = fontCache.getFontInfos(embedStr, 
fileLastModified);
FontCache from line 384:
public EmbedFontInfo[] getFontInfos(String embedUrl, long lastModified) {
CachedFontFile cff = getFontFile(embedUrl);
if (cff.lastModified() == lastModified) {
return cff.getEmbedFontInfos();
} else {
removeFont(embedUrl);

You can see here the usage of the method getLastModified during font removal.
The lastModified calculated there is compared with the lastModified before 
adding a font. Since the calculation is done in two different ways with two 
different results, the font is always removed.

So simply use the working method
public static long getLastModified(URI uri) fom class FontCache
everywhere. The correction must be:

In the class "FontCache" in the method "addFont" replace:
File fontFile = new File(fontUri);
long lastModified = fontFile.lastModified();
with:
long lastModified = getLastModified(fontUri);

That works.



> FontCache throws java.lang.IllegalArgumentException: URI scheme is not "file" 
> for jar embedded fonts
> 
>
> Key: FOP-2532
> URL: https://issues.apache.org/jira/browse/FOP-2532
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Brian Preuß
> Attachments: lastModified-value-on-opaque-URI.patch
>
>
> If using  fop finds fonts embedded in jar files (via 
> MANIFEST.MF entries as described at 
> http://xmlgraphics.apache.org/fop/2.0/fonts.html#autodetect) and tries to add 
> them to the font cache. This throws the following exception:
> {code}
> java.lang.IllegalArgumentException: URI scheme is not "file"
> 26677/0|  at java.io.File.(File.java:421)
> 26677/0|  at org.apache.fop.fonts.FontCache.addFont(FontCache.java:335)
> 26677/0|  at 
> org.apache.fop.fonts.autodetect.FontInfoFinder.getFontInfoFromCustomFont(FontInfoFinder.java:157)
> 26677/0|  at 
> org.apache.fop.fonts.autodetect.FontInfoFinder.find(FontInfoFinder.java:269)
> 26677/0|  at org.apache.fop.fonts.FontAdder.add(FontAdder.java:63)
> 26677/0|  at 
> org.apache.fop.fonts.FontDetectorFactory$DefaultFontDetector.detect(FontDetectorFactory.java:110)
> 26677/0|  at 
> org.apache.fop.fonts.FontManager.autoDetectFonts(FontManager.java:229)
> 26677/0|  at 
> org.apache.fop.fonts.DefaultFontConfigurator.configure(DefaultFontConfigurator.java:82)
> 26677/0|  at 
> org.apache.fop.render.PrintRendererConfigurator.getCustomFontCollection(PrintRendererConfigurator.java:147)
> 26677/0|  at 
> org.apache.fop.render.PrintRendererConfigurator.setupFontInfo(PrintRendererConfigurator.java:127)
> 26677/0|  at 
> org.apache.fop.render.intermediate.IFUtil.setupFonts(IFUtil.java:170)
> 26677/0|  at 
> org.apache.fop.render.intermediate.IFRenderer.setupFontInfo(IFRenderer.java:187)
> 26677/0|  at 
> org.apache.fop.area.RenderPagesModel.(RenderPagesModel.java:75)
> 26677/0|  at 
> org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:135)
> 26677/0|  at 
> org.apache.fop.area.AreaTreeHandler.(AreaTreeHandler.java:105)
> 26677/0|  at 
> org.apache.fop.render.RendererFactory.createFOEventHandler(RendererF

[jira] [Closed] (FOP-2464) fop 1.1 depends on unpublished avalon jars due to wrong org name or version

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner closed FOP-2464.
--
Resolution: Won't Fix

> fop 1.1 depends on unpublished avalon jars due to wrong org name or version
> ---
>
> Key: FOP-2464
> URL: https://issues.apache.org/jira/browse/FOP-2464
> Project: FOP
>  Issue Type: Bug
>Reporter: Patrick Mahoney
>
> We depend on the version of apache fop 1.1 published at 
> https://repo1.maven.org/maven2/org/apache/xmlgraphics/fop/1.1/fop-1.1.jar
> The published version of apache fop 1.1 has declared dependencies on 
> org.apache.avalon.framework:avalon-framework-api:4.2.0
> org.apache.avalon.framework:avalon-framework-impl:4.2.0
> There is no avalon-framework-api or impl jar published in the 
> org.apache.avalon.framework organization with version 4.2.0. The earliest 
> published under this orgname is 4.3.1. 
> I suspect to fix this, the dependency on the avalon framework jars could be 
> bumped to 4.3.1, and the fop jars republished, or a new version cut. 
> Alternately, the org name could be adjusted for the dependency to 
> avalon-framework, there are 4.2.0 jars under that orgname. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (FOP-2255) FOP 1.1's POM file in Maven Central is wrong

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner closed FOP-2255.
--
Resolution: Won't Fix

> FOP 1.1's POM file in Maven Central is wrong
> 
>
> Key: FOP-2255
> URL: https://issues.apache.org/jira/browse/FOP-2255
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 1.1
> Environment: Maven 3
>Reporter: Markus Karg
>Priority: Blocker
>
> When trying to use FOP 1.1 from Maven Central, this will fail due to the fact 
> that its POM file is wrong. It contains a reference to:
> 
>   org.apache.avalon.framework
>   avalon-framework-api
>   4.2.0
> 
> In fact, this JAR exists, but it is not stored in the Group 
> org.apache.avalon.framework but simple in the group avalaon-framework. As a 
> result, it is impossible to use FOP 1.1 from Maven Central! :-(
> I assume that the FOP Team uploaded this POM to Maven Central, so I ask you 
> to fix this POM ASAP. :-)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (FOP-2255) FOP 1.1's POM file in Maven Central is wrong

2015-12-18 Thread simon steiner (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064094#comment-15064094
 ] 

simon steiner edited comment on FOP-2255 at 12/18/15 3:34 PM:
--

Can you try fop 2.0


was (Author: ssteiner1):
Should be fixed in fop 2.0

> FOP 1.1's POM file in Maven Central is wrong
> 
>
> Key: FOP-2255
> URL: https://issues.apache.org/jira/browse/FOP-2255
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 1.1
> Environment: Maven 3
>Reporter: Markus Karg
>Priority: Blocker
>
> When trying to use FOP 1.1 from Maven Central, this will fail due to the fact 
> that its POM file is wrong. It contains a reference to:
> 
>   org.apache.avalon.framework
>   avalon-framework-api
>   4.2.0
> 
> In fact, this JAR exists, but it is not stored in the Group 
> org.apache.avalon.framework but simple in the group avalaon-framework. As a 
> result, it is impossible to use FOP 1.1 from Maven Central! :-(
> I assume that the FOP Team uploaded this POM to Maven Central, so I ask you 
> to fix this POM ASAP. :-)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2255) FOP 1.1's POM file in Maven Central is wrong

2015-12-18 Thread simon steiner (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064094#comment-15064094
 ] 

simon steiner commented on FOP-2255:


Should be fixed in fop 2.0

> FOP 1.1's POM file in Maven Central is wrong
> 
>
> Key: FOP-2255
> URL: https://issues.apache.org/jira/browse/FOP-2255
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 1.1
> Environment: Maven 3
>Reporter: Markus Karg
>Priority: Blocker
>
> When trying to use FOP 1.1 from Maven Central, this will fail due to the fact 
> that its POM file is wrong. It contains a reference to:
> 
>   org.apache.avalon.framework
>   avalon-framework-api
>   4.2.0
> 
> In fact, this JAR exists, but it is not stored in the Group 
> org.apache.avalon.framework but simple in the group avalaon-framework. As a 
> result, it is impossible to use FOP 1.1 from Maven Central! :-(
> I assume that the FOP Team uploaded this POM to Maven Central, so I ask you 
> to fix this POM ASAP. :-)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (FOP-2356) default JAVA_HOME is not compatible with Oracle's JDK on Mac OS X

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2356?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner closed FOP-2356.
--
Resolution: Fixed

> default JAVA_HOME is not compatible with Oracle's JDK on Mac OS X
> -
>
> Key: FOP-2356
> URL: https://issues.apache.org/jira/browse/FOP-2356
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 1.1, trunk
>Reporter: Gaëtan Lehmann
>Assignee: simon steiner
>
> fop uses a java path that was specific to Apple's java and is not compatible 
> with Oracle's java.
> This problem has already been fixed in other tools - see 
> http://svn.apache.org/viewvc/ant/core/trunk/src/script/ant?r1=1238725&r2=1434680&pathrev=1434680&view=patch
>  for example.
> The same patch can be applied as is to fop.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2356) default JAVA_HOME is not compatible with Oracle's JDK on Mac OS X

2015-12-18 Thread simon steiner (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064087#comment-15064087
 ] 

simon steiner commented on FOP-2356:


Added
http://svn.apache.org/viewvc?view=revision&revision=1720811

> default JAVA_HOME is not compatible with Oracle's JDK on Mac OS X
> -
>
> Key: FOP-2356
> URL: https://issues.apache.org/jira/browse/FOP-2356
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 1.1, trunk
>Reporter: Gaëtan Lehmann
>Assignee: simon steiner
>
> fop uses a java path that was specific to Apple's java and is not compatible 
> with Oracle's java.
> This problem has already been fixed in other tools - see 
> http://svn.apache.org/viewvc/ant/core/trunk/src/script/ant?r1=1238725&r2=1434680&pathrev=1434680&view=patch
>  for example.
> The same patch can be applied as is to fop.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (FOP-2356) default JAVA_HOME is not compatible with Oracle's JDK on Mac OS X

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2356?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner reassigned FOP-2356:
--

Assignee: simon steiner

> default JAVA_HOME is not compatible with Oracle's JDK on Mac OS X
> -
>
> Key: FOP-2356
> URL: https://issues.apache.org/jira/browse/FOP-2356
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 1.1, trunk
>Reporter: Gaëtan Lehmann
>Assignee: simon steiner
>
> fop uses a java path that was specific to Apple's java and is not compatible 
> with Oracle's java.
> This problem has already been fixed in other tools - see 
> http://svn.apache.org/viewvc/ant/core/trunk/src/script/ant?r1=1238725&r2=1434680&pathrev=1434680&view=patch
>  for example.
> The same patch can be applied as is to fop.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2464) fop 1.1 depends on unpublished avalon jars due to wrong org name or version

2015-12-18 Thread simon steiner (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064064#comment-15064064
 ] 

simon steiner commented on FOP-2464:


Don't think this is a issue with fop 2.0

> fop 1.1 depends on unpublished avalon jars due to wrong org name or version
> ---
>
> Key: FOP-2464
> URL: https://issues.apache.org/jira/browse/FOP-2464
> Project: FOP
>  Issue Type: Bug
>Reporter: Patrick Mahoney
>
> We depend on the version of apache fop 1.1 published at 
> https://repo1.maven.org/maven2/org/apache/xmlgraphics/fop/1.1/fop-1.1.jar
> The published version of apache fop 1.1 has declared dependencies on 
> org.apache.avalon.framework:avalon-framework-api:4.2.0
> org.apache.avalon.framework:avalon-framework-impl:4.2.0
> There is no avalon-framework-api or impl jar published in the 
> org.apache.avalon.framework organization with version 4.2.0. The earliest 
> published under this orgname is 4.3.1. 
> I suspect to fix this, the dependency on the avalon framework jars could be 
> bumped to 4.3.1, and the fop jars republished, or a new version cut. 
> Alternately, the org name could be adjusted for the dependency to 
> avalon-framework, there are 4.2.0 jars under that orgname. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Issue Comment Deleted] (FOP-2464) fop 1.1 depends on unpublished avalon jars due to wrong org name or version

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner updated FOP-2464:
---
Comment: was deleted

(was: This was fixed in fop 2.0)

> fop 1.1 depends on unpublished avalon jars due to wrong org name or version
> ---
>
> Key: FOP-2464
> URL: https://issues.apache.org/jira/browse/FOP-2464
> Project: FOP
>  Issue Type: Bug
>Reporter: Patrick Mahoney
>
> We depend on the version of apache fop 1.1 published at 
> https://repo1.maven.org/maven2/org/apache/xmlgraphics/fop/1.1/fop-1.1.jar
> The published version of apache fop 1.1 has declared dependencies on 
> org.apache.avalon.framework:avalon-framework-api:4.2.0
> org.apache.avalon.framework:avalon-framework-impl:4.2.0
> There is no avalon-framework-api or impl jar published in the 
> org.apache.avalon.framework organization with version 4.2.0. The earliest 
> published under this orgname is 4.3.1. 
> I suspect to fix this, the dependency on the avalon framework jars could be 
> bumped to 4.3.1, and the fop jars republished, or a new version cut. 
> Alternately, the org name could be adjusted for the dependency to 
> avalon-framework, there are 4.2.0 jars under that orgname. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2464) fop 1.1 depends on unpublished avalon jars due to wrong org name or version

2015-12-18 Thread simon steiner (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064061#comment-15064061
 ] 

simon steiner commented on FOP-2464:


This was fixed in fop 2.0

> fop 1.1 depends on unpublished avalon jars due to wrong org name or version
> ---
>
> Key: FOP-2464
> URL: https://issues.apache.org/jira/browse/FOP-2464
> Project: FOP
>  Issue Type: Bug
>Reporter: Patrick Mahoney
>
> We depend on the version of apache fop 1.1 published at 
> https://repo1.maven.org/maven2/org/apache/xmlgraphics/fop/1.1/fop-1.1.jar
> The published version of apache fop 1.1 has declared dependencies on 
> org.apache.avalon.framework:avalon-framework-api:4.2.0
> org.apache.avalon.framework:avalon-framework-impl:4.2.0
> There is no avalon-framework-api or impl jar published in the 
> org.apache.avalon.framework organization with version 4.2.0. The earliest 
> published under this orgname is 4.3.1. 
> I suspect to fix this, the dependency on the avalon framework jars could be 
> bumped to 4.3.1, and the fop jars republished, or a new version cut. 
> Alternately, the org name could be adjusted for the dependency to 
> avalon-framework, there are 4.2.0 jars under that orgname. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (FOP-2484) Wrong dependency versions in pom.xml

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2484?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner closed FOP-2484.
--
Resolution: Fixed

> Wrong dependency versions in pom.xml
> 
>
> Key: FOP-2484
> URL: https://issues.apache.org/jira/browse/FOP-2484
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Jochen Kemnade
>
> The {{org.apache.xmlgraphics.io}} package seems to be missing completely in 
> the 2.0 JAR. This causes a {{ClassNotFoundException}} when trying to create a 
> {{org.apache.fop.apps.FopFactoryBuilder}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2485) Xalan dependency should be updated

2015-12-18 Thread simon steiner (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064045#comment-15064045
 ] 

simon steiner commented on FOP-2485:


Added:
http://svn.apache.org/viewvc?view=revision&revision=1720793
http://svn.apache.org/viewvc?view=revision&revision=1720803

> Xalan dependency should be updated
> --
>
> Key: FOP-2485
> URL: https://issues.apache.org/jira/browse/FOP-2485
> Project: FOP
>  Issue Type: Wish
>Affects Versions: 2.0
>Reporter: Jochen Kemnade
>Assignee: simon steiner
>
> Fop 2.0 depends on Xalan 2.7.0 via {{batik-dom}}. Xalan 2.7.0 pulls in 
> {{xml-apis:2.0.2}}. That one overrides {{xml-apis:1.3.04}}, which is actually 
> *newer*. (see 
> http://swordsystems.com/2011/06/29/xerces-and-xml-api-dependency-hell/). 
> Updating Xalan to 2.7.2 fixes the issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (FOP-2485) Xalan dependency should be updated

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner closed FOP-2485.
--
Resolution: Fixed

> Xalan dependency should be updated
> --
>
> Key: FOP-2485
> URL: https://issues.apache.org/jira/browse/FOP-2485
> Project: FOP
>  Issue Type: Wish
>Affects Versions: 2.0
>Reporter: Jochen Kemnade
>Assignee: simon steiner
>
> Fop 2.0 depends on Xalan 2.7.0 via {{batik-dom}}. Xalan 2.7.0 pulls in 
> {{xml-apis:2.0.2}}. That one overrides {{xml-apis:1.3.04}}, which is actually 
> *newer*. (see 
> http://swordsystems.com/2011/06/29/xerces-and-xml-api-dependency-hell/). 
> Updating Xalan to 2.7.2 fixes the issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (FOP-2485) Xalan dependency should be updated

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner reassigned FOP-2485:
--

Assignee: simon steiner

> Xalan dependency should be updated
> --
>
> Key: FOP-2485
> URL: https://issues.apache.org/jira/browse/FOP-2485
> Project: FOP
>  Issue Type: Wish
>Affects Versions: 2.0
>Reporter: Jochen Kemnade
>Assignee: simon steiner
>
> Fop 2.0 depends on Xalan 2.7.0 via {{batik-dom}}. Xalan 2.7.0 pulls in 
> {{xml-apis:2.0.2}}. That one overrides {{xml-apis:1.3.04}}, which is actually 
> *newer*. (see 
> http://swordsystems.com/2011/06/29/xerces-and-xml-api-dependency-hell/). 
> Updating Xalan to 2.7.2 fixes the issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2512) java.lang.NullPointerException: Parameter alpha must not be null

2015-12-18 Thread simon steiner (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064020#comment-15064020
 ] 

simon steiner commented on FOP-2512:


Can this be closed?

> java.lang.NullPointerException: Parameter alpha must not be null
> 
>
> Key: FOP-2512
> URL: https://issues.apache.org/jira/browse/FOP-2512
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Mathieu Malaterre
> Attachments: 16x16.png, 19x13.png, 22x22.png
>
>
> fop is not capable of dealing with some PNG, it keeps on failing with:
> Error while rendering page 9
> java.lang.NullPointerException: Parameter alpha must not be null
> Exception
> java.lang.NullPointerException: Parameter alpha must not be null
> Input is:
> $ pnginfo test.png
> test.png...
>   Image Width: 411 Image Length: 225
>   Bitdepth (Bits/Sample): 8
>   Channels (Samples/Pixel): 1
>   Pixel depth (Pixel Depth): 8
>   Colour Type (Photometric Interpretation): PALETTED COLOUR with alpha (18 
> colours, 17 transparent) 
>   Image filter: Single row per byte filter 
>   Interlacing: No interlacing 
>   Compression Scheme: Deflate method 8, 32k window
>   Resolution: 0, 0 (unit unknown)
>   FillOrder: msb-to-lsb
>   Byte Order: Network (Big Endian)
>   Number of text strings: 0 of 0



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (FOP-2506) Support reusing FopFactory with different baseURLs

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner closed FOP-2506.
--
Resolution: Won't Fix

> Support reusing FopFactory with different baseURLs
> --
>
> Key: FOP-2506
> URL: https://issues.apache.org/jira/browse/FOP-2506
> Project: FOP
>  Issue Type: Wish
>  Components: unqualified
>Affects Versions: 2.0
>Reporter: Carsten Pfeiffer
>Priority: Minor
>
> With FOP prior to 2.0 it was possible to set the baseURL used for resolving 
> resources at the user agent. This allowed reusing a single FopFactory for Fop 
> instances with different baseURLs.
> Since 2.0 FOUserAgent.setBaseURL() is not availabe anymore and it is not 
> possible to dynamically specify the baseURL for a Fop instance.
> Our use case is a single user rich client document management application 
> with a PDF export. Resuing the FopFactory is desirable in order not to parse 
> the configuration all the time, looking up fonts, etc.
> That's why I'd love to get the possibility back to dynamically specify the 
> base URL without having to re-do all the configuration and initialization.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2532) FontCache throws java.lang.IllegalArgumentException: URI scheme is not "file" for jar embedded fonts

2015-12-18 Thread simon steiner (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064012#comment-15064012
 ] 

simon steiner commented on FOP-2532:


See https://issues.apache.org/jira/browse/FOP-2554

> FontCache throws java.lang.IllegalArgumentException: URI scheme is not "file" 
> for jar embedded fonts
> 
>
> Key: FOP-2532
> URL: https://issues.apache.org/jira/browse/FOP-2532
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Brian Preuß
> Attachments: lastModified-value-on-opaque-URI.patch
>
>
> If using  fop finds fonts embedded in jar files (via 
> MANIFEST.MF entries as described at 
> http://xmlgraphics.apache.org/fop/2.0/fonts.html#autodetect) and tries to add 
> them to the font cache. This throws the following exception:
> {code}
> java.lang.IllegalArgumentException: URI scheme is not "file"
> 26677/0|  at java.io.File.(File.java:421)
> 26677/0|  at org.apache.fop.fonts.FontCache.addFont(FontCache.java:335)
> 26677/0|  at 
> org.apache.fop.fonts.autodetect.FontInfoFinder.getFontInfoFromCustomFont(FontInfoFinder.java:157)
> 26677/0|  at 
> org.apache.fop.fonts.autodetect.FontInfoFinder.find(FontInfoFinder.java:269)
> 26677/0|  at org.apache.fop.fonts.FontAdder.add(FontAdder.java:63)
> 26677/0|  at 
> org.apache.fop.fonts.FontDetectorFactory$DefaultFontDetector.detect(FontDetectorFactory.java:110)
> 26677/0|  at 
> org.apache.fop.fonts.FontManager.autoDetectFonts(FontManager.java:229)
> 26677/0|  at 
> org.apache.fop.fonts.DefaultFontConfigurator.configure(DefaultFontConfigurator.java:82)
> 26677/0|  at 
> org.apache.fop.render.PrintRendererConfigurator.getCustomFontCollection(PrintRendererConfigurator.java:147)
> 26677/0|  at 
> org.apache.fop.render.PrintRendererConfigurator.setupFontInfo(PrintRendererConfigurator.java:127)
> 26677/0|  at 
> org.apache.fop.render.intermediate.IFUtil.setupFonts(IFUtil.java:170)
> 26677/0|  at 
> org.apache.fop.render.intermediate.IFRenderer.setupFontInfo(IFRenderer.java:187)
> 26677/0|  at 
> org.apache.fop.area.RenderPagesModel.(RenderPagesModel.java:75)
> 26677/0|  at 
> org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:135)
> 26677/0|  at 
> org.apache.fop.area.AreaTreeHandler.(AreaTreeHandler.java:105)
> 26677/0|  at 
> org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:350)
> 26677/0|  at 
> org.apache.fop.fo.FOTreeBuilder.(FOTreeBuilder.java:107)
> 26677/0|  at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:104)
> 26677/0|  at org.apache.fop.apps.Fop.(Fop.java:78)
> 26677/0|  at org.apache.fop.apps.FOUserAgent.newFop(FOUserAgent.java:179)
> 26677/0|  at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:240)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (FOP-2543) The avalon-framework-api-4.2.0 is broken and 4.3.1 is the current version

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2543?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner closed FOP-2543.
--
Resolution: Fixed

> The avalon-framework-api-4.2.0 is broken and 4.3.1 is the current version
> -
>
> Key: FOP-2543
> URL: https://issues.apache.org/jira/browse/FOP-2543
> Project: FOP
>  Issue Type: Improvement
>  Components: unqualified
>Affects Versions: 1.1
> Environment: all
>Reporter: Ron Wheeler
>Assignee: simon steiner
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The 4.2.0 version is broken in Maven Central and 4.3.1 is current.
> Anyone using FOP (DITA-OT for instance) has to manually exclude 4.2.0 to get 
> rid of build warnings.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2543) The avalon-framework-api-4.2.0 is broken and 4.3.1 is the current version

2015-12-18 Thread simon steiner (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15064006#comment-15064006
 ] 

simon steiner commented on FOP-2543:


Added
http://svn.apache.org/viewvc?view=revision&revision=1720799

> The avalon-framework-api-4.2.0 is broken and 4.3.1 is the current version
> -
>
> Key: FOP-2543
> URL: https://issues.apache.org/jira/browse/FOP-2543
> Project: FOP
>  Issue Type: Improvement
>  Components: unqualified
>Affects Versions: 1.1
> Environment: all
>Reporter: Ron Wheeler
>Assignee: simon steiner
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The 4.2.0 version is broken in Maven Central and 4.3.1 is current.
> Anyone using FOP (DITA-OT for instance) has to manually exclude 4.2.0 to get 
> rid of build warnings.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (FOP-2543) The avalon-framework-api-4.2.0 is broken and 4.3.1 is the current version

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2543?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner reassigned FOP-2543:
--

Assignee: simon steiner

> The avalon-framework-api-4.2.0 is broken and 4.3.1 is the current version
> -
>
> Key: FOP-2543
> URL: https://issues.apache.org/jira/browse/FOP-2543
> Project: FOP
>  Issue Type: Improvement
>  Components: unqualified
>Affects Versions: 1.1
> Environment: all
>Reporter: Ron Wheeler
>Assignee: simon steiner
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The 4.2.0 version is broken in Maven Central and 4.3.1 is current.
> Anyone using FOP (DITA-OT for instance) has to manually exclude 4.2.0 to get 
> rid of build warnings.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (FOP-2547) Security: update the Xalan version shipped with FOP

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner closed FOP-2547.
--
Resolution: Fixed

> Security: update the Xalan version shipped with FOP
> ---
>
> Key: FOP-2547
> URL: https://issues.apache.org/jira/browse/FOP-2547
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Lars Teuber
>Assignee: simon steiner
>Priority: Critical
>  Labels: security
>
> There is a security issue in Xalan < 2.7.2, see:
> https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-0107



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2547) Security: update the Xalan version shipped with FOP

2015-12-18 Thread simon steiner (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15063985#comment-15063985
 ] 

simon steiner commented on FOP-2547:


Added
http://svn.apache.org/viewvc?view=revision&revision=1720793

> Security: update the Xalan version shipped with FOP
> ---
>
> Key: FOP-2547
> URL: https://issues.apache.org/jira/browse/FOP-2547
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Lars Teuber
>Assignee: simon steiner
>Priority: Critical
>  Labels: security
>
> There is a security issue in Xalan < 2.7.2, see:
> https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-0107



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (FOP-2547) Security: update the Xalan version shipped with FOP

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner reassigned FOP-2547:
--

Assignee: simon steiner

> Security: update the Xalan version shipped with FOP
> ---
>
> Key: FOP-2547
> URL: https://issues.apache.org/jira/browse/FOP-2547
> Project: FOP
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Lars Teuber
>Assignee: simon steiner
>Priority: Critical
>  Labels: security
>
> There is a security issue in Xalan < 2.7.2, see:
> https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-0107



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (FOP-2554) FopConfig permits file URI for fonts only

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2554?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner updated FOP-2554:
---
Assignee: (was: simon steiner)

> FopConfig permits file URI for fonts only
> -
>
> Key: FOP-2554
> URL: https://issues.apache.org/jira/browse/FOP-2554
> Project: FOP
>  Issue Type: Bug
>  Components: font/unqualified
>Affects Versions: 2.0
> Environment: all flatforms
>Reporter: Mr. Povarnitsyn
>Priority: Minor
>  Labels: font, uri
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> config has following:
>   
>  embed-url="classpath:///fonts/arialuni.ttf">
>   
> 
> Exception on FontCache.java (line 335)
> File fontFile = new File(fontUri);
> My proposal:
> Instead:
> File fontFile = new File(fontUri);
> long lastModified = fontFile.lastModified();
> cachedFontFile = new CachedFontFile(lastModified);
> Write:
>   long lastModified = 0L;
>   if(fontUri.getScheme().equals("file")){
>   File fontFile = new File(fontUri);
>   lastModified = fontFile.lastModified(); 
>   }
> cachedFontFile = new CachedFontFile(lastModified);
> This code is working.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2554) FopConfig permits file URI for fonts only

2015-12-18 Thread simon steiner (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15063973#comment-15063973
 ] 

simon steiner commented on FOP-2554:


I think you use EnvironmentalProfileFactory.createRestrictedIO to disable font 
caching

{code}
String fopxconf = "";
ResourceResolver cloudResourceResolver = 
ResourceResolverFactory.createDefaultResourceResolver();
FopFactoryBuilder confBuilder = new FopConfParser(new 
ByteArrayInputStream(fopxconf.getBytes()),
EnvironmentalProfileFactory.createRestrictedIO(new 
File(".").toURI(), cloudResourceResolver)).getFopFactoryBuilder();
FopFactory fopFactory = confBuilder.build();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
FileOutputStream fos = new FileOutputStream("out.png");
Fop fop = fopFactory.newFop("image/png", foUserAgent, fos);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
Source src = new StreamSource(new ByteArrayInputStream(fo.getBytes()));
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
fos.close();

{code}

> FopConfig permits file URI for fonts only
> -
>
> Key: FOP-2554
> URL: https://issues.apache.org/jira/browse/FOP-2554
> Project: FOP
>  Issue Type: Bug
>  Components: font/unqualified
>Affects Versions: 2.0
> Environment: all flatforms
>Reporter: Mr. Povarnitsyn
>Assignee: simon steiner
>Priority: Minor
>  Labels: font, uri
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> config has following:
>   
>  embed-url="classpath:///fonts/arialuni.ttf">
>   
> 
> Exception on FontCache.java (line 335)
> File fontFile = new File(fontUri);
> My proposal:
> Instead:
> File fontFile = new File(fontUri);
> long lastModified = fontFile.lastModified();
> cachedFontFile = new CachedFontFile(lastModified);
> Write:
>   long lastModified = 0L;
>   if(fontUri.getScheme().equals("file")){
>   File fontFile = new File(fontUri);
>   lastModified = fontFile.lastModified(); 
>   }
> cachedFontFile = new CachedFontFile(lastModified);
> This code is working.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (FOP-2554) FopConfig permits file URI for fonts only

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2554?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner reassigned FOP-2554:
--

Assignee: simon steiner

> FopConfig permits file URI for fonts only
> -
>
> Key: FOP-2554
> URL: https://issues.apache.org/jira/browse/FOP-2554
> Project: FOP
>  Issue Type: Bug
>  Components: font/unqualified
>Affects Versions: 2.0
> Environment: all flatforms
>Reporter: Mr. Povarnitsyn
>Assignee: simon steiner
>Priority: Minor
>  Labels: font, uri
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> config has following:
>   
>  embed-url="classpath:///fonts/arialuni.ttf">
>   
> 
> Exception on FontCache.java (line 335)
> File fontFile = new File(fontUri);
> My proposal:
> Instead:
> File fontFile = new File(fontUri);
> long lastModified = fontFile.lastModified();
> cachedFontFile = new CachedFontFile(lastModified);
> Write:
>   long lastModified = 0L;
>   if(fontUri.getScheme().equals("file")){
>   File fontFile = new File(fontUri);
>   lastModified = fontFile.lastModified(); 
>   }
> cachedFontFile = new CachedFontFile(lastModified);
> This code is working.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (FOP-2407) Docs examples wrong

2015-12-18 Thread simon steiner (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

simon steiner closed FOP-2407.
--
Resolution: Not A Problem

> Docs examples wrong
> ---
>
> Key: FOP-2407
> URL: https://issues.apache.org/jira/browse/FOP-2407
> Project: FOP
>  Issue Type: Bug
>Reporter: simon steiner
>
> http://xmlgraphics.apache.org/fop/trunk/servlets.html
> has:
> FopFactory fopFactory = FopFactory.newInstance();
> api has changed



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (FOP-2554) FopConfig permits file URI for fonts only

2015-12-18 Thread Mr. Povarnitsyn (JIRA)
Mr. Povarnitsyn created FOP-2554:


 Summary: FopConfig permits file URI for fonts only
 Key: FOP-2554
 URL: https://issues.apache.org/jira/browse/FOP-2554
 Project: FOP
  Issue Type: Bug
  Components: font/unqualified
Affects Versions: 2.0
 Environment: all flatforms
Reporter: Mr. Povarnitsyn
Priority: Minor


config has following:

  

  


Exception on FontCache.java (line 335)
File fontFile = new File(fontUri);
My proposal:

Instead:
File fontFile = new File(fontUri);
long lastModified = fontFile.lastModified();
cachedFontFile = new CachedFontFile(lastModified);
Write:
long lastModified = 0L;
if(fontUri.getScheme().equals("file")){
File fontFile = new File(fontUri);
lastModified = fontFile.lastModified(); 
}
cachedFontFile = new CachedFontFile(lastModified);

This code is working.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)