roscoe81 / enviro-monitor

An environment monitor based on a Raspberry Pi Zero W, a Pimoroni Enviro+ and a Plantower air quality sensor to monitor, display and report on air particles, gases, temperature, humidity, noise and air pressure.
MIT License
80 stars 26 forks source link

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

Open jerbzz opened 2 months ago

jerbzz commented 2 months ago

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