Skip to content

Fixed frombytes() for images with a zero dimension#7493

Merged
radarhere merged 2 commits into
python-pillow:mainfrom
radarhere:frombytes
Nov 3, 2023
Merged

Fixed frombytes() for images with a zero dimension#7493
radarhere merged 2 commits into
python-pillow:mainfrom
radarhere:frombytes

Conversation

@radarhere

Copy link
Copy Markdown
Member

Resolves #7492

The issue found that calling Image.frombytes for an image with zero size and no data - e.g. Image.frombytes("L", (0, 0), b"") - raises an error.

This fixes that, and the corresponding situation for im.frombytes().

This is the inverse of #5938

@radarhere
radarhere merged commit a5a6ca1 into python-pillow:main Nov 3, 2023
@radarhere
radarhere deleted the frombytes branch November 3, 2023 07:56
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.

Image.frombytes throws on empty image

2 participants