mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-09 06:44:45 +03:00
Merge 3a25b1cd9b
into 0da8bfed62
This commit is contained in:
commit
69ad104c5f
|
@ -423,7 +423,7 @@ def _getexif(self):
|
|||
# get exif extension
|
||||
try:
|
||||
file.seek(exif[0x8769])
|
||||
except KeyError:
|
||||
except (KeyError, TypeError):
|
||||
pass
|
||||
else:
|
||||
info = TiffImagePlugin.ImageFileDirectory(head)
|
||||
|
|
BIN
Tests/images/exif_typeerror.jpg
Normal file
BIN
Tests/images/exif_typeerror.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
|
@ -166,6 +166,12 @@ class TestFileJpeg(PillowTestCase):
|
|||
im = hopper()
|
||||
im.save(f, 'JPEG', quality=90, exif=b"1"*65532)
|
||||
|
||||
def test_exif_typeerror(self):
|
||||
im = Image.open('Tests/images/exif_typeerror.jpg')
|
||||
|
||||
# Should not raise a TypeError
|
||||
im._getexif()
|
||||
|
||||
def test_progressive_compat(self):
|
||||
im1 = self.roundtrip(hopper())
|
||||
im2 = self.roundtrip(hopper(), progressive=1)
|
||||
|
|
Loading…
Reference in New Issue
Block a user