Skip to content

Commit 88cd6d4

Browse files
radarherehugovk
andauthored
Rearranged comments
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy