mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-24 14:14:47 +03:00
Test showing failure opening image without supplied fix #3003 on 32bit systems
This commit is contained in:
parent
a780a51f9e
commit
5954bacc92
BIN
Tests/images/corrupt_exif.jpg
Normal file
BIN
Tests/images/corrupt_exif.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 388 KiB |
|
@ -633,6 +633,11 @@ class TestFileJpeg(PillowTestCase):
|
||||||
# Act / Assert
|
# Act / Assert
|
||||||
self.assertEqual(im._getexif()[306], "2017:03:13 23:03:09")
|
self.assertEqual(im._getexif()[306], "2017:03:13 23:03:09")
|
||||||
|
|
||||||
|
def test_bad_exif_overflow_32(self):
|
||||||
|
# This image has some corrupt exif offsets that unpack to values greater
|
||||||
|
# than ssize_t on 32 bit systems
|
||||||
|
im = Image.open('Tests/images/corrupt_exif.jpg')
|
||||||
|
|
||||||
def test_photoshop(self):
|
def test_photoshop(self):
|
||||||
im = Image.open("Tests/images/photoshop-200dpi.jpg")
|
im = Image.open("Tests/images/photoshop-200dpi.jpg")
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
|
|
@ -776,7 +776,7 @@ class ImageFileDirectory_v2(MutableMapping):
|
||||||
except OverflowError as e:
|
except OverflowError as e:
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
print(
|
print(
|
||||||
"- offset value wrong. Possibly corrupt EXIF data. ", e
|
"Offset too large. Possibly corrupt EXIF data. ", e
|
||||||
)
|
)
|
||||||
continue # ignore corrupt EXIF data
|
continue # ignore corrupt EXIF data
|
||||||
data = ImageFile._safe_read(fp, size)
|
data = ImageFile._safe_read(fp, size)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user