Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2237

java.io.IOException: Image stream is empty for inline image

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.6, 1.8.7, 2.0.0
    • 1.8.7, 2.0.0
    • Rendering
    • None

    Description

      The attached file throws an exception:

      java.io.IOException: Image stream is empty
      	at org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.getRGBImage(SampledImageReader.java:117)
      	at org.apache.pdfbox.pdmodel.graphics.image.PDInlineImage.getImage(PDInlineImage.java:234)
      	at org.apache.pdfbox.rendering.PageDrawer.drawImage(PageDrawer.java:1082)
      	at org.apache.pdfbox.util.operator.graphics.BeginInlineImage.process(BeginInlineImage.java:40)
      

      The reason is this:

      BI
      /H 1 /W 256 /CS /RGB /BPC 8 /F []
      ...
      

      The empty filter array is incorrectly processed in PDInlineImage, it results in an empty output stream. Checking for an empty array like checking for null solves the problem.

      Attachments

        1. PDFBOX-2237-041715.pdf
          26 kB
          Tilman Hausherr

        Activity

          People

            tilman Tilman Hausherr
            tilman Tilman Hausherr
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: