Raise ValueError when WMF inch is zero by radarhere · Pull Request #8600 · python-pillow/Pillow
Navigation Menu
{{ message }}
python-pillow / Pillow Public
- Notifications You must be signed in to change notification settings
- Fork 2.4k
Merged
Raise ValueError when WMF inch is zero#8600
hugovk merged 1 commit intopython-pillow:mainfrom
Raise ValueError when WMF inch is zero#8600
hugovk merged 1 commit intopython-pillow:mainfrom
Conversation
Copy link Copy Markdown
Member
radarhere
commented
Dec 15, 2024
radarhere
commented
Resolves #8597
The issue is concerned that a ZeroDivisionError may be raised if self._inch is zero.
Pillow/src/PIL/WmfImagePlugin.py
Lines 104 to 107 in a7338f8
| size = ( | |
| (x1 - x0) * self.info["dpi"] // self._inch, | |
| (y1 - y0) * self.info["dpi"] // self._inch, | |
| ) |
This raises a ValueError of "Invalid inch" first.
radarhere
mentioned this pull request
hugovk
merged commit
cbc55c4
into
python-pillow:main
radarhere
deleted the
inch
branch
eyedav pushed a commit to eyedav/Pillow that referenced this pull request
Jul 19, 2025Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment