Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 4.2, 4.2.1
-
Fix Version/s: 4.2.2
-
Component/s: Core/Parsing
-
Labels:None
-
Environment:All
Description
The following error is thrown when trying to render an image in a customer PDF:
Jun 7, 2011 2:15:59 PM org.icepdf.core.pobjects.Resources getImage
FINE: Error getting image by name: Im7
java.lang.ClassCastException: java.util.Hashtable cannot be cast to org.icepdf.core.pobjects.Stream
at org.icepdf.core.pobjects.Stream.jbig2Decode(Stream.java:846)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2121)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2032)
at org.icepdf.core.pobjects.Resources.getImage(Resources.java:264)
at org.icepdf.core.util.ContentParser.parse(ContentParser.java:478)
at org.icepdf.core.pobjects.Page.init(Page.java:390)
at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1077)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Jun 7, 2011 2:15:59 PM org.icepdf.core.pobjects.Resources getImage
FINE: Error getting image by name: Im7
java.lang.ClassCastException: java.util.Hashtable cannot be cast to org.icepdf.core.pobjects.Stream
at org.icepdf.core.pobjects.Stream.jbig2Decode(Stream.java:846)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2121)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2032)
at org.icepdf.core.pobjects.Resources.getImage(Resources.java:264)
at org.icepdf.core.util.ContentParser.parse(ContentParser.java:478)
at org.icepdf.core.pobjects.Page.init(Page.java:390)
at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1077)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
The PDF generator in question is doing a strange circular reference when specifying an JBIG2 images JBIG2Globals. Basically the reference points back to the original image which is incorrect. Normally if no JBIG2Globals are specified the value should be null or omitted.
Good news is that it's an easy fix to get the Image in question to render correctly.