Christian, This was actually discussed as part of Bug 13866 but really should have been separated. Repeated partially here: ==== Start of copy from Bug 13866 ==== ------- Additional Comments From Manuel Mall 2002-11-19 01:20 ------- .... Regarding the resolving of URIs in FopImageFactory you say it works for you under Linux. I can say it doesn't work for me under Linux. Could it be that we are using different JDKs (I use IBM 1.3.0) and that the behaviour of the URL constructor "new URL(context, spec)" has changed? Any way, what I observe is that if basedir is something like "file:/..." and the URL in the external- graphics tag is also "file:/...", ie. has the protocol included (which it has for all the FOP examples), then the constructor mentioned above does not resolve any relative paths in "spec" as it contains a protocol component which according to the URL RFC means it is an absolute URL. ------- Additional Comments From Christian Geisert 2002-11-28 14:01 ------- I just had a look a the current source with regards to relative URLs. The relative part is done with a URL.getFile() which returns the path without "file:" on the Sun JDK. Is this different with the IBM JDK? ==== End of copy from Bug 13866 ==== I just got the latest maintenance branch CVS build it and then tried to build the doc/examples which returned errors for all images. To explain the error I added one line of debug statement to FopImageFactory. Here is the log for the first example: [fop] /home/mm/fop-dev/xml-fop/docs/examples/fo/bgimage.fo - > /home/mm/fop-dev/xml-fop/docs/examples/tests/bgimage.pdf [fop] [INFO] building formatting object tree [fop] [INFO] setting up fonts [fop] baseURL=file:/home/mm/fop-dev/xml-fop/docs/examples/fo/ absoluteURL.getFile()=/graphics/xml_feather_transparent.gif absoluteURL=file:/graphics/xml_feather_transparent.gif [fop] Error creating background image: Error while recovering Image Informations (file:/graphics/xml_feather_transparent.gif) : /graphics/xml_feather_transparent .gif (No such file or directory) [fop] [INFO] [1] [fop] baseURL=file:/home/mm/fop-dev/xml-fop/docs/examples/fo/ absoluteURL.getFile()=/graphics/linux.bmp absoluteURL=file:/graphics/linux.bmp [fop] Error creating background image: Error while recovering Image Informations (file:/graphics/linux.bmp) : /graphics/linux.bmp (No such file or directory) The actual URLs used in bgimage.fo are: "file:../../graphics/xml_feather_transparent.gif" "file:../../graphics/linux.bmp" Obviously they are not correctly resolved. I then reapplied the part of the patch (originally provided with bug 13866) which deals with these relative URLs and now it works for me. [fop] /home/mm/fop-dev/xml-fop/docs/examples/fo/bgimage.fo - > /home/mm/fop-dev/xml-fop/docs/examples/tests/bgimage.pdf [fop] [INFO] building formatting object tree [fop] [INFO] setting up fonts [fop] baseURL=file:/home/mm/fop-dev/xml-fop/docs/examples/fo/ href=../../graphics/xml_feather_transparent.gif absoluteURL=file:/home/mm/fop- dev/xml-fop/docs/graphics/xml_feather_transparent.gif [fop] [INFO] [1] [fop] baseURL=file:/home/mm/fop-dev/xml-fop/docs/examples/fo/ href=../../graphics/linux.bmp absoluteURL=file:/home/mm/fop-dev/xml- fop/docs/graphics/linux.bmp
Created attachment 3985 [details] Diff of FopImageFactory.java
Committed, thanks.
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed