Raise ValueError for negative values when loading P1-P3 PPM images by radarhere · Pull Request #7882 · 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 for negative values when loading P1-P3 PPM images#7882
hugovk merged 1 commit intopython-pillow:mainfrom
Raise ValueError for negative values when loading P1-P3 PPM images#7882
hugovk merged 1 commit intopython-pillow:mainfrom
Conversation
Copy link Copy Markdown
Member
radarhere
commented
Mar 16, 2024
radarhere
commented
Helps #7876
Pillow currently raises a ValueError when a value is too large in a P1-P3 PPM image.
Pillow/src/PIL/PpmImagePlugin.py
Lines 273 to 275 in 794a7d6
| if value > maxval: | |
| msg_str = f"Channel value too large for this mode: {value}" | |
| raise ValueError(msg_str) |
This adds another ValueError if the value is negative.
radarhere
changed the title
Raise a ValueError for negative values when loading P1-P3 PPM images
Raise ValueError for negative values when loading P1-P3 PPM images
radarhere
mentioned this pull request
hugovk
merged commit
ca97370
into
python-pillow:main
radarhere
deleted the
ppm
branch
radarhere added a commit to radarhere/Pillow that referenced this pull request
Mar 24, 2024
data-sync-user
mentioned this pull request
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