Skip to content

Commit

Permalink
Rearranged comments
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo van Kemenade <[email protected]>
  • Loading branch information
radarhere and hugovk committed Jun 28, 2024
1 parent b84c970 commit 88cd6d4
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/PIL/JpegImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,18 +487,13 @@ def _read_dpi_from_exif(self) -> None:
dpi *= 2.54

Check warning on line 487 in src/PIL/JpegImagePlugin.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/JpegImagePlugin.py#L474-L487

Added lines #L474 - L487 were not covered by tests
self.info["dpi"] = dpi, dpi
except (
struct.error,
KeyError,
SyntaxError,
TypeError,
ValueError,
ZeroDivisionError,
struct.error, # truncated EXIF
KeyError, # dpi not included

Check warning on line 491 in src/PIL/JpegImagePlugin.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/JpegImagePlugin.py#L489-L491

Added lines #L489 - L491 were not covered by tests
SyntaxError, # invalid/unreadable EXIF
TypeError, # dpi is an invalid float
ValueError, # dpi is an invalid float
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

def _getmp(self):
Expand Down

0 comments on commit 88cd6d4

Please sign in to comment.