Skip to content

Commit

Permalink
BUG: Column default for CCITTFaxDecode (#1079)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma authored Jul 9, 2022
1 parent 9b048a2 commit f4f74c7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions PyPDF2/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,9 @@ class CCITTFaxDecode:
def _get_parameters(
parameters: Union[None, ArrayObject, DictionaryObject], rows: int
) -> CCITParameters:
# TABLE 3.9 Optional parameters for the CCITTFaxDecode filter
k = 0
columns = 0
columns = 1728
if parameters:
if isinstance(parameters, ArrayObject):
for decode_parm in parameters:
Expand All @@ -419,8 +420,10 @@ def _get_parameters(
if CCITT.K in decode_parm:
k = decode_parm[CCITT.K]
else:
columns = parameters[CCITT.COLUMNS] # type: ignore
k = parameters[CCITT.K] # type: ignore
if CCITT.COLUMNS in parameters:
columns = parameters[CCITT.COLUMNS] # type: ignore
if CCITT.K in parameters:
k = parameters[CCITT.K] # type: ignore

return CCITParameters(k, columns, rows)

Expand Down

0 comments on commit f4f74c7

Please sign in to comment.