Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Raise ValueError for negative values when loading P1-P3 PPM images #7882

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

radarhere
Copy link
Member

Helps #7876

Pillow currently raises a ValueError when a value is too large in a P1-P3 PPM image.

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 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 Mar 16, 2024
@hugovk hugovk merged commit ca97370 into python-pillow:main Mar 21, 2024
57 checks passed
@radarhere radarhere deleted the ppm branch March 21, 2024 21:17
radarhere added a commit to radarhere/Pillow that referenced this pull request Mar 24, 2024
hugovk added a commit that referenced this pull request Mar 25, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants