Details
-
Bug
-
Status: Resolved
-
Resolution: Fixed
-
1.3.1
-
None
-
None
-
Operating System: Solaris
Platform: Sun
Description
I'm including a PNG file in a document and FOP is crashing with the following exception. This previously worked in fop 0.94. Note that there's a typo in the error message and that could also be fixed.
java.lang.IllegalStateException: The resolution mus be set
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)
---------
java.lang.IllegalStateException: The resolution mus be set
at org.apache.xmlgraphics.image.loader.ImageSize.calcSizeFromPixels(ImageSize.java:210)
The PNG file in question was created using Dia. pngcheck for the image shows:
OK: a.png (567x400, 24-bit RGB, non-interlaced, 96.0%)
pngmeta showed nothing. My guess is that there is no information in the image to indicate DPI. Surely, in this situation, it should just be guessing. The XSL-FO used is as follows:
<fo:external-graphic src="url(a.png)" width="432pt" height="auto" content-width="scale-to-fit" content-height="scale-to-fit" content-type="content-type:image/png" text-align="center"/>
Given that it is scaling, I would have thought that the resolution should be irrelevant. The XSL-FO file came from Docbook-xsl but I can reproduce it by copying the file into a hello world XSL-FO file.
I'd prefer not to post the image file publicly but if anyone needs it, I can e-mail it privately.
Oliver Kiddle