roscoe81/enviro-monitor

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

Opened this issue · 0 comments

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