Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 4.3.2
-
Fix Version/s: 4.3.3
-
Component/s: Core/Parsing
-
Labels:None
-
Environment:All
Description
The following exceptions are thrown when loading a PDF:
FINE: Error building image raster.
java.lang.IllegalArgumentException: Width (2480) and height (0) must be > 0
at java.awt.image.SampleModel.<init>(SampleModel.java:108)
at java.awt.image.MultiPixelPackedSampleModel.<init>(MultiPixelPackedSampleModel.java:129)
at java.awt.image.MultiPixelPackedSampleModel.<init>(MultiPixelPackedSampleModel.java:89)
at java.awt.image.Raster.createPackedRaster(Raster.java:843)
at org.icepdf.core.pobjects.Stream.makeImageWithRasterFromBytes(Stream.java:2492)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2387)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2250)
at org.icepdf.core.pobjects.Resources.getImage(Resources.java:246)
at org.icepdf.core.util.ContentParser.consume_Do(ContentParser.java:1980)
at org.icepdf.core.util.ContentParser.parse(ContentParser.java:373)
at org.icepdf.core.pobjects.Page.init(Page.java:372)
at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1072)
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:662)
14-May-2012 10:34:26 AM org.icepdf.core.pobjects.Resources getImage
FINE: Error getting image by name: Im0
java.lang.IllegalArgumentException: Width (2480) and height (0) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999)
at java.awt.image.BufferedImage.<init>(BufferedImage.java:321)
at org.icepdf.core.pobjects.Stream.parseImage(Stream.java:2751)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2411)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2250)
at org.icepdf.core.pobjects.Resources.getImage(Resources.java:246)
at org.icepdf.core.util.ContentParser.consume_Do(ContentParser.java:1980)
at org.icepdf.core.util.ContentParser.parse(ContentParser.java:373)
at org.icepdf.core.pobjects.Page.init(Page.java:372)
at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1072)
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:662)
FINE: Error building image raster.
java.lang.IllegalArgumentException: Width (2480) and height (0) must be > 0
at java.awt.image.SampleModel.<init>(SampleModel.java:108)
at java.awt.image.MultiPixelPackedSampleModel.<init>(MultiPixelPackedSampleModel.java:129)
at java.awt.image.MultiPixelPackedSampleModel.<init>(MultiPixelPackedSampleModel.java:89)
at java.awt.image.Raster.createPackedRaster(Raster.java:843)
at org.icepdf.core.pobjects.Stream.makeImageWithRasterFromBytes(Stream.java:2492)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2387)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2250)
at org.icepdf.core.pobjects.Resources.getImage(Resources.java:246)
at org.icepdf.core.util.ContentParser.consume_Do(ContentParser.java:1980)
at org.icepdf.core.util.ContentParser.parse(ContentParser.java:373)
at org.icepdf.core.pobjects.Page.init(Page.java:372)
at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1072)
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:662)
14-May-2012 10:34:26 AM org.icepdf.core.pobjects.Resources getImage
FINE: Error getting image by name: Im0
java.lang.IllegalArgumentException: Width (2480) and height (0) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999)
at java.awt.image.BufferedImage.<init>(BufferedImage.java:321)
at org.icepdf.core.pobjects.Stream.parseImage(Stream.java:2751)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2411)
at org.icepdf.core.pobjects.Stream.getImage(Stream.java:2250)
at org.icepdf.core.pobjects.Resources.getImage(Resources.java:246)
at org.icepdf.core.util.ContentParser.consume_Do(ContentParser.java:1980)
at org.icepdf.core.util.ContentParser.parse(ContentParser.java:373)
at org.icepdf.core.pobjects.Page.init(Page.java:372)
at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1072)
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:662)
Activity
Arran Mccullough
created issue -
Arran Mccullough
made changes -
Field | Original Value | New Value |
---|---|---|
Salesforce Case | [5007000000MG2ZH] |
Patrick Corless
made changes -
Fix Version/s | 4.3.3 [ 10333 ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #30229 | Wed Jul 25 09:24:42 MDT 2012 | patrick.corless | |
Files Changed | ||||
MODIFY
/icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Stream.java
|
Patrick Corless
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Patrick Corless
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
After a quick look the PDF in question is malformed in that the height of the image is not addressable. In this particular case the image is build a pixel at a time using two for loops for width and height. It should be possible to figure out the height of the image given the image width and colour depth.