From 5b348bb695e20080bb27ff011f4f70d3525413d3 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Mon, 29 Jun 2015 15:37:58 -0700 Subject: [PATCH] Fail on invalid EXIF, reverting ed2cca1. --- Tests/test_file_tiff.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index 350e68e42..9a9285ca6 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -84,10 +84,8 @@ class TestFileTiff(PillowTestCase): self.assertEqual(im.info['dpi'], (72., 72.)) def test_bad_exif(self): - try: - Image.open('Tests/images/hopper_bad_exif.jpg')._getexif() - except struct.error: - self.fail("Bad EXIF data should not pass incorrect values to _binary unpack") + image = Image.open('Tests/images/hopper_bad_exif.jpg') + self.assertRaises(Exception, image._getexif) def test_little_endian(self): im = Image.open('Tests/images/16bit.cropped.tif')