Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere authored and Yay295 committed Jun 25, 2024
1 parent 6b73511 commit ed37056
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Binary file added Tests/images/unknown_mode.j2k
Binary file not shown.
6 changes: 6 additions & 0 deletions Tests/test_file_jpeg2k.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,12 @@ def test_issue_6194() -> None:
assert im.getpixel((5, 5)) == 31


def test_unknown_j2k_mode() -> None:
with pytest.raises(UnidentifiedImageError):
with Image.open("Tests/images/unknown_mode.j2k"):
pass


def test_unbound_local() -> None:
# prepatch, a malformed jp2 file could cause an UnboundLocalError exception.
with pytest.raises(OSError):
Expand Down

0 comments on commit ed37056

Please sign in to comment.