summaryrefslogtreecommitdiff
path: root/tests/test_image_access.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_image_access.py')
-rw-r--r--tests/test_image_access.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_image_access.py b/tests/test_image_access.py
index d321e8f..68ab407 100644
--- a/tests/test_image_access.py
+++ b/tests/test_image_access.py
@@ -231,3 +231,18 @@ def test_image_palette(resources, filename, bpc):
def test_bool_in_inline_image():
piim = PdfInlineImage(image_data=b'', image_object=(Name.IM, True))
assert piim.image_mask
+
+
+def test_jp2(resources):
+ pdf = Pdf.open(resources / 'pike-jp2.pdf')
+ pim = PdfImage(next(iter(pdf.pages[0].images.values())))
+
+ assert '/JPXDecode' in pim.filters
+ assert pim.colorspace == '/DeviceRGB'
+ assert not pim.is_inline
+ assert not pim.indexed
+ assert pim.mode == 'RGB'
+ assert pim.bits_per_component == 8
+
+ outstream = BytesIO()
+ pim.extract_to(stream=outstream)