mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
Removed TypeError exception check in JpegImagePlugin; Updated comments in test
This commit is contained in:
parent
a2b0269167
commit
f53b86b673
|
@ -635,11 +635,11 @@ class TestFileJpeg(PillowTestCase):
|
||||||
self.assertEqual(im.info.get("dpi"), (72, 72))
|
self.assertEqual(im.info.get("dpi"), (72, 72))
|
||||||
|
|
||||||
def test_invalid_exif_x_resolution(self):
|
def test_invalid_exif_x_resolution(self):
|
||||||
# When no x or y resolution defined in EXIF
|
# When no x or y resolution is defined in EXIF
|
||||||
im = Image.open("Tests/images/invalid-exif-without-x-resolution.jpg")
|
im = Image.open("Tests/images/invalid-exif-without-x-resolution.jpg")
|
||||||
|
|
||||||
# This should return the default, and not a ValueError or
|
# This should return the default, and not a ValueError or
|
||||||
# OSError for unidentified image.
|
# OSError for an unidentified image.
|
||||||
self.assertEqual(im.info.get("dpi"), (72, 72))
|
self.assertEqual(im.info.get("dpi"), (72, 72))
|
||||||
|
|
||||||
def test_ifd_offset_exif(self):
|
def test_ifd_offset_exif(self):
|
||||||
|
|
|
@ -172,7 +172,7 @@ def APP(self, marker):
|
||||||
# 1 dpcm = 2.54 dpi
|
# 1 dpcm = 2.54 dpi
|
||||||
dpi *= 2.54
|
dpi *= 2.54
|
||||||
self.info["dpi"] = int(dpi + 0.5), int(dpi + 0.5)
|
self.info["dpi"] = int(dpi + 0.5), int(dpi + 0.5)
|
||||||
except (KeyError, TypeError, SyntaxError, ValueError, ZeroDivisionError):
|
except (KeyError, SyntaxError, ValueError, ZeroDivisionError):
|
||||||
# SyntaxError for invalid/unreadable EXIF
|
# SyntaxError for invalid/unreadable EXIF
|
||||||
# KeyError for dpi not included
|
# KeyError for dpi not included
|
||||||
# ZeroDivisionError for invalid dpi rational value
|
# ZeroDivisionError for invalid dpi rational value
|
||||||
|
|
Loading…
Reference in New Issue
Block a user