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

Fix coordinates for Pillow>9.4.0 #6

Merged
merged 3 commits into from
Dec 8, 2023

Conversation

many-hats
Copy link
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
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.

None yet

2 participants