Skip to content

Allow 0 size images, Fixes #2259#2262

Merged
wiredfool merged 4 commits into
python-pillow:masterfrom
wiredfool:zero_size
Dec 31, 2016
Merged

Allow 0 size images, Fixes #2259#2262
wiredfool merged 4 commits into
python-pillow:masterfrom
wiredfool:zero_size

Conversation

@wiredfool

Copy link
Copy Markdown
Member

Fixes #2259 .

Changes proposed in this pull request:

  • Allow 0x0 images to be created. Restores pre 3.4 behavior

Comment thread PIL/Image.py
if size[0] <= 0 or size[1] <= 0:
raise ValueError("Width and Height must be > 0")
if size[0] < 0 or size[1] < 0:
raise ValueError("Width and Height must be => 0")

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.

Change => to >=, and might as well be a small h too:

"Width and height must be >= 0"

@homm

homm commented Nov 30, 2016

Copy link
Copy Markdown
Member

There are more tests required. We should check not only 0x0 construction but also basic operations against such images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants