Skip to content

Commit

Permalink
fix: satisfy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
dhdaines committed Jul 10, 2024
1 parent f39109e commit d1c1bac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions pdfminer/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,16 @@ def export_image(self, image: LTImage) -> str:
elif image.bits == 1:
name = self._save_bmp(image, width, height, (width + 7) // 8, image.bits)

elif image.bits == 8 and (LITERAL_DEVICE_RGB in image.colorspace
or LITERAL_INLINE_DEVICE_RGB in image.colorspace):
elif image.bits == 8 and (
LITERAL_DEVICE_RGB in image.colorspace
or LITERAL_INLINE_DEVICE_RGB in image.colorspace
):
name = self._save_bmp(image, width, height, width * 3, image.bits * 3)

elif image.bits == 8 and (LITERAL_DEVICE_GRAY in image.colorspace
or LITERAL_INLINE_DEVICE_GRAY in image.colorspace):
elif image.bits == 8 and (
LITERAL_DEVICE_GRAY in image.colorspace
or LITERAL_INLINE_DEVICE_GRAY in image.colorspace
):
name = self._save_bmp(image, width, height, width, image.bits)

elif len(filters) == 1 and filters[0][0] in LITERALS_FLATE_DECODE:
Expand Down
2 changes: 1 addition & 1 deletion pdfminer/pdfinterp.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
)
from pdfminer.pdfpage import PDFPage
from pdfminer.pdftypes import (
LITERALS_ASCII85_DECODE,
PDFObjRef,
PDFStream,
dict_value,
list_value,
resolve1,
stream_value,
LITERALS_ASCII85_DECODE,
)
from pdfminer.psexceptions import PSEOF, PSTypeError
from pdfminer.psparser import (
Expand Down
2 changes: 1 addition & 1 deletion pdfminer/psparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def _parse_string_1(self, s: bytes, i: int) -> int:

elif self.oct:
chrcode = int(self.oct, 8)
assert chrcode < 256, "Invalid octal %s (%d)" % (self.oct, chrcode)
assert chrcode < 256, "Invalid octal %s (%d)" % (repr(self.oct), chrcode)
self._curtoken += bytes((int(self.oct, 8),))
self._parse1 = self._parse_string
return i
Expand Down

0 comments on commit d1c1bac

Please sign in to comment.