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 deprecation of pillow textsize() and getsize() methods #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jerbzz
Copy link

@jerbzz jerbzz commented Jul 1, 2024

Hello

As per #19, the code fails when running with Pillow 10+.

This PR replaces textsize() with textbbox() and getsize() with getbbox(), allowing for the altered return data structure of these methods - it's now a 4-tuple of x0, y0, x1, y1.

x1 and y1 can be considered equivalent to width and height for our case.

I've only been able to test on the Enviro+, without particulate or noise monitoring (this is also broken for Bookworm, I think!). I only have one unit so I can't test it in indoor/outdoor mode.

Hope this is helpful.

James

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.

1 participant