ICEpdf
  1. ICEpdf
  2. PDF-434

IllegalArgumentException: Width (2480) and height (0) must be > 0

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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)

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #30229 Wed Jul 25 09:24:42 MDT 2012 patrick.corless PDF-434 added a small check for height equals zero and assign the width. This tries to address a few malformed PDF that do not correctly specify the image height.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/Stream.java

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: