We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b2711c3 + 62e6d62 commit 6c55dffCopy full SHA for 6c55dff
Tests/images/end_trunc_file.png renamed to Tests/images/truncated_end_chunk.png
Tests/test_file_png.py
@@ -778,11 +778,15 @@ class MyStdOut:
778
with Image.open(mystdout) as reloaded:
779
assert_image_equal_tofile(reloaded, TEST_PNG_FILE)
780
781
- def test_end_truncated_file(self):
+ def test_truncated_end_chunk(self):
782
+ with Image.open("Tests/images/truncated_end_chunk.png") as im:
783
+ with pytest.raises(OSError):
784
+ im.load()
785
+
786
ImageFile.LOAD_TRUNCATED_IMAGES = True
787
try:
- with Image.open("Tests/images/end_trunc_file.png") as im:
- assert_image_equal_tofile(im, "Tests/images/end_trunc_file.png")
788
789
+ assert_image_equal_tofile(im, "Tests/images/hopper.png")
790
finally:
791
ImageFile.LOAD_TRUNCATED_IMAGES = False
792
0 commit comments