FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Raise ValueError when trying to save empty JPEG by radarhere · Pull Request #6159 · python-pillow/Pillow · GitHub

Raise ValueError when trying to save empty JPEG - #6159

Merged
hugovk merged 1 commit into
python-pillow:mainfrom
radarhere:jpeg_zero
Mar 28, 2022
Merged

Raise ValueError when trying to save empty JPEG#6159
hugovk merged 1 commit into
python-pillow:mainfrom
radarhere:jpeg_zero

Conversation

Copy link
Copy Markdown
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.

hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
Member Author

Ok, done.

hugovk commented Mar 28, 2022

Copy link
Copy Markdown
Member

Thanks!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL