Skip to content

Commit 88b21e7

Browse files
radarhereYay295
authored andcommitted
Added test
1 parent 58d5a73 commit 88b21e7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Tests/images/unknown_mode.j2k

318 Bytes
Binary file not shown.

Tests/test_file_jpeg2k.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,12 @@ def test_issue_6194() -> None:
335335
assert im.getpixel((5, 5)) == 31
336336

337337

338+
def test_unknown_j2k_mode() -> None:
339+
with pytest.raises(UnidentifiedImageError):
340+
with Image.open("Tests/images/unknown_mode.j2k"):
341+
pass
342+
343+
338344
def test_unbound_local() -> None:
339345
# prepatch, a malformed jp2 file could cause an UnboundLocalError exception.
340346
with pytest.raises(OSError):

0 commit comments

Comments
 (0)