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

Wrong handling of PNG predictors with FlateDecode, patch attached

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.1
    • 1.3.1
    • Parsing
    • None

    Description

      The current implementation of PNG predictors for FlateDecode (class FlateFilter) is based on a wrong interpretation of predictor semantic. It assumes that predictor 15 (optimum) must be specified in order to use PNG prediction and predictor 10 (PNG NONE) would mean no prediction. Latter one is correct as type for an image row but wrong in its meaning for whole image. As specification states if one of the PNG predictor values are defined as 'Predictor' parameter value it only means that PNG prediction is in use (independent if it is 10, 11, ..., 15).
      I have attached a patch which removes predictor value '10' from 'no prediction' code and which triggers PNG prediction for all values >= 10.
      The bug can be tested with https://www.cryptool.org/trac/CrypTool2/export/1909/trunk/Documentation/Developer/PluginHowTo/HowToDeveloper.pdf
      Here e.g. on page 6 in the screenshot image (Im3) the rows are shifted by a pixel each 3 lines which is a result of the not interpreted predictor byte of the rows. The predictor value for the image is 10 (PNG NONE).

      Attachments

        1. pdfbox_issue822.patch
          2 kB
          Timo Boehme

        Activity

          People

            Unassigned Unassigned
            tboehme Timo Boehme
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified