Skip to content

Commit 88cd6d4

Browse files
radarherehugovk
andauthored
Rearranged comments
Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent b84c970 commit 88cd6d4

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/PIL/JpegImagePlugin.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -487,18 +487,13 @@ def _read_dpi_from_exif(self) -> None:
487487
dpi *= 2.54
488488
self.info["dpi"] = dpi, dpi
489489
except (
490-
struct.error,
491-
KeyError,
492-
SyntaxError,
493-
TypeError,
494-
ValueError,
495-
ZeroDivisionError,
490+
struct.error, # truncated EXIF
491+
KeyError, # dpi not included
492+
SyntaxError, # invalid/unreadable EXIF
493+
TypeError, # dpi is an invalid float
494+
ValueError, # dpi is an invalid float
495+
ZeroDivisionError, # invalid dpi rational value
496496
):
497-
# struct.error for truncated EXIF
498-
# KeyError for dpi not included
499-
# SyntaxError for invalid/unreadable EXIF
500-
# ValueError or TypeError for dpi being an invalid float
501-
# ZeroDivisionError for invalid dpi rational value
502497
self.info["dpi"] = 72, 72
503498

504499
def _getmp(self):

0 commit comments

Comments
 (0)