Fop Fans,

Attached you will find 2 fo files 
-  http://www.nabble.com/file/p24235918/t1.fo t1.fo 
-  http://www.nabble.com/file/p24235918/t2.fo t2.fo 

and two image files 
-  http://www.nabble.com/file/p24235918/hexley.png hexley.png 
-  http://www.nabble.com/file/p24235918/h%25C3%25A9xl%25C3%25A6.png
héxlæ.png 

The same image actually with a different name. The second has a name with
unicode characters in (not sure it will make it on the list using nabble)

The issue I am struggling with (illustrated in attached java program 
http://www.nabble.com/file/p24235918/FopUriResolver.java FopUriResolver.java
)  is that when a URIResolver is used to find the image files, FOP (I assume
the image library) refuses to load the image when it contains unicode
characters in its name. If I comment out the uri resolver it works just
fine.


So, with the url resolver enabled I get

0    [main] DEBUG org.apache.fop.apps.FOUserAgent(415) - target-resolution
set to: 72.0dpi (px2mm=0.35277778)
resolve on hexley.png canRead returns true
1418 [main] DEBUG org.apache.fop.apps.FOUserAgent(415) - target-resolution
set to: 72.0dpi (px2mm=0.35277778)
resolve on héxlæ.png canRead returns true
1426 [main] ERROR
org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext(104) -
Error while opening file. Could not load image from system identifier
'file:/eb2/trunk/playground/h%C3%A9xl%C3%A6.png'
(/eb2/trunk/playground/héxl�.png (No such file or directory))
1426 [main] ERROR org.apache.fop.fo.flow.ExternalGraphic(83) - Image not
found: héxlæ.png

and t2.pdf does not have the image embedded

With the uri resolver disabled it returns

    [main] DEBUG org.apache.fop.apps.FOUserAgent(415) - target-resolution
set to: 72.0dpi (px2mm=0.35277778)
1384 [main] DEBUG org.apache.fop.apps.FOUserAgent(415) - target-resolution
set to: 72.0dpi (px2mm=0.35277778)

and both pdfs are ok


I think the problem might lie in AbstractImageSessionContext#toFile where
unicode escapes are apparently not taken into account.


It does not reproduce with JDK 1.5 only with JDK1.6.

I would sure appreciate any tips on how to fix or workaround this issue

Many thanks indeed

Peter
-- 
View this message in context: 
http://www.nabble.com/URIResolver-in-combination-with-filenames-with-unicode-characters-fails---Problem-in-AbstractImageSessionContext-toFile--tp24235918p24235918.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to