Skip to content

Fix coordinates for Pillow>9.4.0#6

Merged
straussmaximilian merged 3 commits intostraussmaximilian:mainfrom
many-hats:main
Dec 8, 2023
Merged

Fix coordinates for Pillow>9.4.0#6
straussmaximilian merged 3 commits intostraussmaximilian:mainfrom
many-hats:main

Conversation

@many-hats
Copy link
Copy Markdown
Contributor

As of Pillow 9.5.0, it is required that x1 >=x- and y1>=y0. See this PR for discussion. Pillow docs state that for ImageDraw.rectangle, xy is a

Sequence of either [(x0, y0), (x1, y1)] or [x0, y0, x1, y1], where x1 >= x0 and y1 >= y0. The bounding box is inclusive of both endpoints.

Simply switching the order of y1 and y2 fixes the following error for all subsequent versions of Pillow:

ValueError: y1 must be greater than or equal to y0

@straussmaximilian straussmaximilian merged commit 1be9c23 into straussmaximilian:main Dec 8, 2023
@straussmaximilian
Copy link
Copy Markdown
Owner

Looks goods to me, thanks!

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