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

NPE in JBig2Filter if BitsPerComponent is missing

    XMLWordPrintableJSON

Details

    Description

      From Erik Zeiske in the mailing list:

      I have an issue with PDFBox and the handling of a MRC Compressed PDF.

      The issue is related to the JBIG2 Compression used in the PDF. If I
      try to extract the different Images used in the PDF attached, the
      library throws an NullPointerException cause the Bits are not defined
      in the JBIG2-Filter. I think this is because in the PDF there is no
      "Bits per Component" defined in the JBIG2-Image. If I try to define
      the Bits in the JAVA-Code the program runs without an error, but it
      doesn't apply the JBIG2 mask properly to the foreground-colour-image
      of the PDF. To fix this issue I tried to extract the mask into a file,
      but it seems like the mask-image is the same as the foreground-image.
      I couldn't find the reason for this and I don't think it is related to
      the PDF itself.

      I haven't understood all of this (maybe it is moot after the upcoming bugfix), but one thing is sure: an NPE is thrown if BitsPerComponent does not exist.

      Our code can only process bpc=1, so we can use that one as default.

      Edit: I've now understood the 2nd problem, it will be handled in PDFBOX-3559.

      Attachments

        1. PDFBOX-3558.pdf
          1.19 MB
          Tilman Hausherr

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: