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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.6, 1.8.7, 2.0.0
    • Fix Version/s: 1.8.7, 2.0.0
    • Component/s: Rendering
    • Labels:
      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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: