summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJames R. Barlow <jim@purplerock.ca>2019-07-08 01:54:14 -0700
committerJames R. Barlow <jim@purplerock.ca>2019-07-08 01:54:14 -0700
commit3b6578d8e4423cbf4a0d49e5abe5bc27cfa8a409 (patch)
tree54b6c1fed21763d5f25fefab3f4958a5d34e0958 /tests
parent427f7f0ea325e7e7cb87ebf55f6678dc9310b526 (diff)
Deal with simple cases of stacked compression on JPXDecode images
Diffstat (limited to 'tests')
-rw-r--r--tests/resources/pike-flate-jp2.pdfbin0 -> 18471 bytes
-rw-r--r--tests/test_image_access.py10
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/resources/pike-flate-jp2.pdf b/tests/resources/pike-flate-jp2.pdf
new file mode 100644
index 0000000..c074e69
--- /dev/null
+++ b/tests/resources/pike-flate-jp2.pdf
Binary files differ
diff --git a/tests/test_image_access.py b/tests/test_image_access.py
index 47ffccb..d4625d5 100644
--- a/tests/test_image_access.py
+++ b/tests/test_image_access.py
@@ -322,3 +322,13 @@ def test_icc_extract(resources):
pim = PdfImage(xobj)
assert pim.as_pil_image().info['icc_profile'] == pim.icc.tobytes()
+
+
+def test_stacked_compression(resources):
+ xobj, _pdf = first_image_in(resources / 'pike-flate-jp2.pdf')
+
+ pim = PdfImage(xobj)
+ assert pim.mode == 'RGB'
+ assert pim.colorspace == '/DeviceRGB'
+ assert pim.bits_per_component == 8
+ assert pim.filters == ['/FlateDecode', '/JPXDecode']