Bug 43506 - NPE using a Tiff Image
Summary: NPE using a Tiff Image
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: images (show other bugs)
Version: trunk
Hardware: All Windows XP
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-28 08:25 UTC by Chris Bowditch
Modified: 2012-04-07 01:51 UTC (History)
0 users



Attachments
Test FO (661 bytes, text/plain)
2007-09-28 08:29 UTC, Chris Bowditch
Details
TIFF that causes NPE (8.86 KB, application/octet-stream)
2007-09-28 08:30 UTC, Chris Bowditch
Details
patch file to fix NPE (2.50 KB, patch)
2007-10-01 04:16 UTC, Adrian Cumiskey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Bowditch 2007-09-28 08:25:57 UTC
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)
Comment 1 Chris Bowditch 2007-09-28 08:29:43 UTC
Created attachment 20893 [details]
Test FO
Comment 2 Chris Bowditch 2007-09-28 08:30:27 UTC
Created attachment 20894 [details]
TIFF that causes NPE
Comment 3 Adrian Cumiskey 2007-10-01 04:16:05 UTC
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.
Comment 4 Jeremias Maerki 2007-11-07 01:21:08 UTC
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.
Comment 5 Glenn Adams 2012-04-07 01:41:28 UTC
resetting P2 open bugs to P3 pending further review