diff --git a/Tests/images/exif_typeerror.jpg b/Tests/images/exif_typeerror.jpg new file mode 100644 index 000000000..550859a0a Binary files /dev/null and b/Tests/images/exif_typeerror.jpg differ diff --git a/Tests/test_file_jpeg.py b/Tests/test_file_jpeg.py index 25c599a17..371b7037b 100644 --- a/Tests/test_file_jpeg.py +++ b/Tests/test_file_jpeg.py @@ -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)