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

Pillow 10 has removed the "getsize" and "textsize" methods #19

Open
jerbzz opened this issue Jun 30, 2024 · 0 comments
Open

Pillow 10 has removed the "getsize" and "textsize" methods #19

jerbzz opened this issue Jun 30, 2024 · 0 comments

Comments

@jerbzz
Copy link

jerbzz commented Jun 30, 2024

Hello

When using this code, I ran across a breaking change in Pillow 10 and had to force pip to install Pillow 9.5.0 to make it work. With Pillow 10 it doesn't run at all. The methods getsize and textsize have been deprecated since 9.2.0 and were removed in Pillow 10.

This (Pillow 9.5.0) generates lots of warnings:

/home/james/enviro-monitor/./Northcliff_AQI_Monitor_Gen.py:1312: DeprecationWarning: getsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use getbbox or getlength instead. w, h = font.getsize(text)

/home/james/enviro-monitor/./Northcliff_AQI_Monitor_Gen.py:569: DeprecationWarning: textsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use textbbox or textlength instead.

Pillow's documentation on this: https://pillow.readthedocs.io/en/stable/deprecations.html#font-size-and-offset-methods

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

No branches or pull requests

1 participant