From 3d2a8d3a73f3b88a9ea1def01f777bd436063b1d Mon Sep 17 00:00:00 2001 From: dotrunghieu96 Date: Wed, 8 Nov 2023 02:49:27 +0000 Subject: [PATCH] move flate decode to higher priority --- pdfminer/image.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pdfminer/image.py b/pdfminer/image.py index 61c2673e..a978a33f 100644 --- a/pdfminer/image.py +++ b/pdfminer/image.py @@ -110,6 +110,9 @@ def export_image(self, image: LTImage) -> str: elif len(filters) == 1 and filters[0][0] in LITERALS_JPX_DECODE: name = self._save_jpeg2000(image) + elif len(filters) == 1 and filters[0][0] in LITERALS_FLATE_DECODE: + name = self._save_bytes(image) + elif self._is_jbig2_iamge(image): name = self._save_jbig2(image) @@ -122,9 +125,6 @@ def export_image(self, image: LTImage) -> str: elif image.bits == 8 and LITERAL_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: - name = self._save_bytes(image) - else: name = self._save_raw(image)