Attached PNG causes a NPE when rendering to RTF. Submitted by Dominic Brugger (brugger.at.puzzle.ch) Stack trace below: SEVERE: Error while handling an external-graphic: null java.lang.NullPointerException at org.apache.commons.io.IOUtils.copy(IOUtils.java:920) at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:215) at org.apache.fop.image.AbstractFopImage.loadDefaultOriginalData (AbstractFopImage.java:223) at org.apache.fop.image.ImageIOImage.loadOriginalData (ImageIOImage.java:217) at org.apache.fop.image.AbstractFopImage.load (AbstractFopImage.java:174) at org.apache.fop.render.rtf.RTFHandler.image(RTFHandler.java:1131) at org.apache.fop.render.rtf.RTFHandler.invokeDeferredEvent (RTFHandler.java:1492) at org.apache.fop.render.rtf.RTFHandler.recurseFONode (RTFHandler.java:1616) at org.apache.fop.render.rtf.RTFHandler.recurseFONode (RTFHandler.java:1687) at org.apache.fop.render.rtf.RTFHandler.recurseFONode (RTFHandler.java:1687) at org.apache.fop.render.rtf.RTFHandler.recurseFONode (RTFHandler.java:1639) at org.apache.fop.render.rtf.RTFHandler.endPageSequence (RTFHandler.java:
Created attachment 19242 [details] PNG
Yet another reason for a redesign of the image package. The reason for the NPE is the loadBitmap() call in ImageIOImage.loadDimensions(). The class decodes the full image in order to get at the dimensions and loadBitmap() closes the InputStream when it's done. I don't have time right now to test that it won't break anything but one could change loadDimensions() in ImageIOImage so it doesn't call loadBitmap() if it has the resolution and extents of the image (which it can get from the ImageReader). When this is done all image formats that are registered in ImageFactory for loading with ImageIOImage need to be retested with RTF and at least PDF output. HTH
resetting P2 open bugs to P3 pending further review
change status from ASSIGNED to NEW for consistency