I receive the following NPE when running the attahed FO and TIFF image: SEVERE: Exception java.lang.NullPointerException at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115) at org.apache.fop.cli.Main.startFOP(Main.java:166) at org.apache.fop.cli.Main.main(Main.java:197) --------- java.lang.NullPointerException at org.apache.fop.image.TIFFImage.decodeImage(TIFFImage.java:77) at org.apache.fop.image.XmlGraphicsCommonsImage.loadDimensions (XmlGraphi csCommonsImage.java:79) at org.apache.fop.image.AbstractFopImage.load (AbstractFopImage.java:160) at org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:75) at org.apache.fop.fo.FObj.processNode(FObj.java:125) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement (FOTreeBuil der.java:313) at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:180) at org.apache.xalan.transformer.TransformerIdentityImpl.startElement (Tra nsformerIdentityImpl.java:1072) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Sour ce) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement (Unkn own Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement (Unkn own Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent Dispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument (Un known Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.transform (Transf ormerIdentityImpl.java:484) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115) at org.apache.fop.cli.Main.startFOP(Main.java:166) at org.apache.fop.cli.Main.main(Main.java:197)
Created attachment 20893 [details] Test FO
Created attachment 20894 [details] TIFF that causes NPE
Created attachment 20901 [details] patch file to fix NPE This patch will fix the null pointer exception and provides more informative log output when there are TIFF directory fields missing. The resulting image in the PDF and PS output is still corrupted for this particular image. My guess is that there is still a problem with correctly identifying and processing BILEVEL/GRAYSCALE images in xmlgraphics-commons org.apache.xmlgraphics.image.codec.tiff.TIFFImage. Unfortunately I don't have time at the moment to investigate this further. Adrian.
There's a little problem with the patch: The TIFF spec says that "inches" is the default resolution unit. So it is possible to always determine the resolution unit. I'll make sure this is done properly in the image package redesign.
resetting P2 open bugs to P3 pending further review