Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Raise ValueError when trying to save empty JPEG #6159

Merged
merged 1 commit into from Mar 28, 2022

Conversation

radarhere
Copy link
Member

Suggested in #5944 (comment)

The JPEG format does not support saving an image with zero width or height. This PR raises a ValueError for the situation, rather than the SystemError that is currently raised.

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Optional suggestion: this could even be the very first check before the OSError, as it's arguably a more fundamental problem than changing the mode.

@radarhere
Copy link
Member Author

Ok, done.

@hugovk
Copy link
Member

hugovk commented Mar 28, 2022

Thanks!

@hugovk hugovk merged commit 4459dfa into python-pillow:main Mar 28, 2022
@radarhere radarhere deleted the jpeg_zero branch March 28, 2022 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants