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

ClassCastException in PDXObjectImage.getMask

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.1
    • 1.7.0
    • PDModel
    • None

    Description

      Certain /FlateDecode encoded images which contain a Mask Dictionary cause the getRGBImage() method to fail with the following exception:

      java.lang.ClassCastException: org.apache.pdfbox.cos.COSStream cannot be cast to org.apache.pdfbox.cos.COSArray
      at org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage.getMask(PDXObjectImage.java:364)
      at org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap.getRGBImage(PDPixelMap.java:205)
      at org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap.write2OutputStream(PDPixelMap.java:310)
      at org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage.write2file(PDXObjectImage.java:139)
      at ImagePdfBoxTest2.main(ImagePdfBoxTest2.java:41)

      I will attach a simple test program and a test dokument which was created with OpenOffice 3.2.

      Attachments

        1. culprit.pdf
          14 kB
          Marko Mocnik
        2. ImagePdfBoxTest2.java
          1 kB
          Marko Mocnik

        Activity

          People

            lehmi Andreas Lehmkühler
            karlika Marko Mocnik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: