Skip to content

Commit

Permalink
STY: Tweak comments
Browse files Browse the repository at this point in the history
  • Loading branch information
j-t-1 authored Jan 26, 2025
1 parent ad97deb commit 3aea613
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pypdf/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def decompress(data: bytes) -> bytes:
"""
Decompress the given data using zlib.
This function attempts to decompress the input data using zlib. If the
decompression fails due to a zlib error, it falls back to using a
decompression object with a larger window size.
Attempts to decompress the input data using zlib.
If the decompression fails due to a zlib error, it falls back
to using a decompression object with a larger window size.
Args:
data: The input data to be decompressed.
Expand All @@ -84,10 +84,10 @@ def decompress(data: bytes) -> bytes:
return zlib.decompress(data)
except zlib.error:
try:
# For larger files, use Decompress object to enable buffered reading
# For larger files, use decompression object to enable buffered reading
return zlib.decompressobj().decompress(data)
except zlib.error:
# If still failed, then try with increased window size
# If still failing, then try with increased window size
d = zlib.decompressobj(zlib.MAX_WBITS | 32)
result_str = b""
for b in [data[i : i + 1] for i in range(len(data))]:
Expand Down Expand Up @@ -294,7 +294,7 @@ def decode(
logger_warning(
"missing EOD in ASCIIHexDecode, check if output is OK", __name__
)
break # reach End Of String even if no EOD
break # Reached end of string even if no EOD
char = data[index : index + 1]
if char == b">":
break
Expand Down Expand Up @@ -494,10 +494,11 @@ class CCITTParameters:
@property
def group(self) -> int:
if self.K < 0:
# Pure two-dimensional encoding (Group 4)
CCITTgroup = 4
else:
# k == 0: Pure one-dimensional encoding (Group 3, 1-D)
# k > 0: Mixed one- and two-dimensional encoding (Group 3, 2-D)
# K == 0: Pure one-dimensional encoding (Group 3, 1-D)
# K > 0: Mixed one- and two-dimensional encoding (Group 3, 2-D)
CCITTgroup = 3
return CCITTgroup

Expand Down

0 comments on commit 3aea613

Please sign in to comment.