Wrong handling of PNG predictors with FlateDecode, patch attached
-----------------------------------------------------------------
Key: PDFBOX-822
URL: https://issues.apache.org/jira/browse/PDFBOX-822
Project: PDFBox
Issue Type: Bug
Components: Parsing
Affects Versions: 1.3.0
Reporter: Timo Boehme
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).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.