Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 5.0.5
-
Fix Version/s: 5.0.6
-
Component/s: Core/Parsing
-
Labels:None
-
Environment:All
-
Support Case References:Support Case #12748 - https://icesoft.my.salesforce.com/5007000000aejV2
Description
There are two issues seen with the provided PDF file depending on the JBig2 library used.
With the Jpedal libraries the following error stack trace is thrown when rendering page 7(Issue similar toPDF-675):
WARNING: Problem loading JBIG2 image:
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.icepdf.core.pobjects.ImageStream.jbig2Decode(ImageStream.java:786)
at org.icepdf.core.pobjects.ImageStream.getImage(ImageStream.java:373)
at org.icepdf.core.pobjects.ImageStream.getImage(ImageStream.java:306)
at org.icepdf.core.pobjects.graphics.SmoothScaledImageReference.call(SmoothScaledImageReference.java:95)
at org.icepdf.core.pobjects.graphics.SmoothScaledImageReference.call(SmoothScaledImageReference.java:39)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IndexOutOfBoundsException: bitIndex < 0: -1400
at java.util.BitSet.clear(BitSet.java:532)
at java.util.BitSet.set(BitSet.java:458)
at org.jpedal.jbig2.image.JBIG2Bitmap.setPixel(JBIG2Bitmap.java:1022)
at org.jpedal.jbig2.image.JBIG2Bitmap.setPixel(JBIG2Bitmap.java:1026)
at org.jpedal.jbig2.image.JBIG2Bitmap.combine(JBIG2Bitmap.java:841)
at org.jpedal.jbig2.image.JBIG2Bitmap.readTextRegion(JBIG2Bitmap.java:749)
at org.jpedal.jbig2.segment.region.text.TextRegionSegment.readSegment(TextRegionSegment.java:301)
at org.jpedal.jbig2.decoders.JBIG2StreamDecoder.readSegments(JBIG2StreamDecoder.java:432)
at org.jpedal.jbig2.decoders.JBIG2StreamDecoder.decodeJBIG2(JBIG2StreamDecoder.java:174)
at org.jpedal.jbig2.JBIG2Decoder.decodeJBIG2(JBIG2Decoder.java:148)
... 13 more
With the Levigo library included, the same error that is reported inPDF-727 is thrown when rendering the first page.
With the Jpedal libraries the following error stack trace is thrown when rendering page 7(Issue similar to
WARNING: Problem loading JBIG2 image:
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.icepdf.core.pobjects.ImageStream.jbig2Decode(ImageStream.java:786)
at org.icepdf.core.pobjects.ImageStream.getImage(ImageStream.java:373)
at org.icepdf.core.pobjects.ImageStream.getImage(ImageStream.java:306)
at org.icepdf.core.pobjects.graphics.SmoothScaledImageReference.call(SmoothScaledImageReference.java:95)
at org.icepdf.core.pobjects.graphics.SmoothScaledImageReference.call(SmoothScaledImageReference.java:39)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IndexOutOfBoundsException: bitIndex < 0: -1400
at java.util.BitSet.clear(BitSet.java:532)
at java.util.BitSet.set(BitSet.java:458)
at org.jpedal.jbig2.image.JBIG2Bitmap.setPixel(JBIG2Bitmap.java:1022)
at org.jpedal.jbig2.image.JBIG2Bitmap.setPixel(JBIG2Bitmap.java:1026)
at org.jpedal.jbig2.image.JBIG2Bitmap.combine(JBIG2Bitmap.java:841)
at org.jpedal.jbig2.image.JBIG2Bitmap.readTextRegion(JBIG2Bitmap.java:749)
at org.jpedal.jbig2.segment.region.text.TextRegionSegment.readSegment(TextRegionSegment.java:301)
at org.jpedal.jbig2.decoders.JBIG2StreamDecoder.readSegments(JBIG2StreamDecoder.java:432)
at org.jpedal.jbig2.decoders.JBIG2StreamDecoder.decodeJBIG2(JBIG2StreamDecoder.java:174)
at org.jpedal.jbig2.JBIG2Decoder.decodeJBIG2(JBIG2Decoder.java:148)
... 13 more
With the Levigo library included, the same error that is reported in
Issue Links
- duplicates
-
PDF-727 NullPointerException thrown from levigo library
- Closed
I found an issue with how we are passing in the external global segments that are defined in a PDF dictionary. The lack of this segment information was causing the image to fail to load.