Skip to content

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
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants