Skip to content

Commit

Permalink
Test error is raised without LOAD_TRUNCATED_IMAGES
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jan 16, 2024
1 parent fe7b6d9 commit de6f27e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Tests/test_file_png.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,10 @@ class MyStdOut:
assert_image_equal_tofile(reloaded, TEST_PNG_FILE)

def test_end_truncated_file(self):
with Image.open("Tests/images/end_trunc_file.png") as im:
with pytest.raises(OSError):
im.load()

ImageFile.LOAD_TRUNCATED_IMAGES = True
try:
with Image.open("Tests/images/end_trunc_file.png") as im:
Expand Down

0 comments on commit de6f27e

Please sign in to comment.