[ https://issues.apache.org/jira/browse/XGC-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17812316#comment-17812316 ]
Simon Steiner commented on XGC-140: ----------------------------------- You can try disabling raw png in the fop.xconf: <image-loading> <penalty value="10000" class="org.apache.xmlgraphics.image.loader.impl.PreloaderRawPNG"/> <penalty value="10000" class="org.apache.xmlgraphics.image.loader.impl.ImageLoaderRawPNG"/> </image-loading> > Processing an interlaced image throws an "Unknown interlace method: 1" error > ---------------------------------------------------------------------------- > > Key: XGC-140 > URL: https://issues.apache.org/jira/browse/XGC-140 > Project: XMLGraphicsCommons > Issue Type: Bug > Components: image codecs > Affects Versions: 2.9 > Reporter: Roland Traier-Kiss > Priority: Major > Attachments: interlaced_image.png > > > h2. Overview > There seems to be an issue/bug in xmlgraphics-commons which throws an error > whenever an interlaced image is encountered. The error is the following: > > {code:java} > java.lang.RuntimeException: I/O error reading PNG file. > file:\\\D:\interlaced_image.png at > org.apache.xmlgraphics.image.loader.impl.PNGFile.<init>(PNGFile.java:117) at > org.apache.xmlgraphics.image.loader.impl.ImageLoaderRawPNG.loadImage(ImageLoaderRawPNG.java:73) > at > org.apache.xmlgraphics.image.loader.pipeline.ImageProviderPipeline.execute(ImageProviderPipeline.java:153)at > > org.apache.xmlgraphics.image.loader.pipeline.ImageProviderPipeline.execute(ImageProviderPipeline.java:98) > at > org.apache.xmlgraphics.image.loader.ImageManager.getImage(ImageManager.java:269) > at > org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingImageHandler(AbstractIFPainter.java:163) > at > org.apache.fop.render.pdf.PDFPainter.drawImageUsingURI(PDFPainter.java:219) > at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:182) at > org.apache.fop.render.intermediate.IFRenderer.drawImage(IFRenderer.java:1306) > at > org.apache.fop.render.intermediate.IFRenderer.renderImage(IFRenderer.java:1293) > at > org.apache.fop.render.AbstractRenderer.renderInlineViewport(AbstractRenderer.java:1030) > at > org.apache.fop.render.AbstractPathOrientedRenderer.renderInlineViewport(AbstractPathOrientedRenderer.java:836) > at > org.apache.fop.render.intermediate.IFRenderer.renderInlineViewport(IFRenderer.java:860) > at > org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:877) > at > org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:924) > at > org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:845) > at > org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:704) > at > org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:758) > at > org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:1004) > at > org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:689) > at > org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:591) > at > org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:789) > at > org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:568) > at > org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:433) > at > org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:380) > at > org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:735) > at > org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:345) > at > org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:318) > at > org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:584) > at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:123) at > org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:316) > at > org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:243) > at > org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:147) > at > org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267) > at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:140) > at > org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:390) > at org.apache.fop.fo.FOTreeBuilder$3.run(FOTreeBuilder.java:207) at > org.apache.fop.fo.FOTreeBuilder$3.run(FOTreeBuilder.java:204) at > java.base/java.security.AccessController.doPrivileged(Native Method) at > org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:203) > ... > Caused by: java.lang.RuntimeException: Unsupported PNG interlace method: 1 > at > org.apache.xmlgraphics.image.loader.impl.PNGFile.parse_IHDR_chunk(PNGFile.java:207) > at org.apache.xmlgraphics.image.loader.impl.PNGFile.<init>(PNGFile.java:89) > {code} > > h2. Steps to reproduce > # Have the following installed: > ## FOP 2.9 > ## Batik 1.17 (which uses/depends on xmlgraphics-commons 2.9) > # Try to process {{<fo:external-graphic > src="file:\\\D:\interlaced_image.png"/>}} (the image has been attached to the > issue) > h2. Expected behavior > A correct PDF is generated > h2. Actual behavior > The above error message is generated > h2. Additional notes > FOP 2.9 with Batik 1.16 works (probably because it uses/depends on > xmlgraphics-commons 2.7), but Batik 1.16 is vulnerable. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: general-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: general-h...@xmlgraphics.apache.org