From ISO 32000, §7.4.4.3, LZWDecode and FlateDecode Parameters, Table 8, FlateDecode.decode() seems to be supposed to define a default value for the /Columns key in the /DecodeParms dictionary.
# predictor 1 == no predictor
if predictor != 1:
columns = decodeParms["/Columns"]
# PNG prediction:
if predictor >= 10 and predictor <= 15:
And here how I intend to fix it:
if predictor != 1:
# The /Columns param. has 1 as the default value; see ISO 32000,
# §7.4.4.3 LZWDecode and FlateDecode Parameters, Table 8
columns = decodeParms.get("/Columns", 1)
# PNG prediction:
if 10 <= predictor <= 15:
I noticed the (small) flaw during a unit test, that is soon going to be published.
From ISO 32000, §7.4.4.3, LZWDecode and FlateDecode Parameters, Table 8,
FlateDecode.decode()
seems to be supposed to define a default value for the/Columns
key in the/DecodeParms
dictionary.Here is how it appeared before in PyPDF4/filters.py:121:
And here how I intend to fix it:
I noticed the (small) flaw during a unit test, that is soon going to be published.