Rearranged comments

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
Andrew Murray 2024-06-28 17:28:42 +10:00 committed by GitHub
parent b84c970fbf
commit 88cd6d41ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -487,18 +487,13 @@ class JpegImageFile(ImageFile.ImageFile):
dpi *= 2.54 dpi *= 2.54
self.info["dpi"] = dpi, dpi self.info["dpi"] = dpi, dpi
except ( except (
struct.error, struct.error, # truncated EXIF
KeyError, KeyError, # dpi not included
SyntaxError, SyntaxError, # invalid/unreadable EXIF
TypeError, TypeError, # dpi is an invalid float
ValueError, ValueError, # dpi is an invalid float
ZeroDivisionError, ZeroDivisionError, # invalid dpi rational value
): ):
# struct.error for truncated EXIF
# KeyError for dpi not included
# SyntaxError for invalid/unreadable EXIF
# ValueError or TypeError for dpi being an invalid float
# ZeroDivisionError for invalid dpi rational value
self.info["dpi"] = 72, 72 self.info["dpi"] = 72, 72
def _getmp(self): def _getmp(self):