python-microscope / microscope

Python library for control of microscope devices, supporting hardware triggers and distribution of devices over the network for performance and flexibility.

Home Page:https://www.python-microscope.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pillow 10 removes 'getsize' from 'FreeTypeFont'

juliomateoslangerak opened this issue · comments

Getting images from the simulatedCamera returns this exception: 'ImageFont' object has no attribute 'getsize'

It seems that getsize was removed from the FreeTypeFont. (tensorflow/models#11040)

The fix seems to be using getbbox. I tested replacing in the simulated camera getImage method and things work fine:

            size = tuple(d + 2 for d in self._font.getsize(text))

with

            size = tuple(d + 2 for d in self._font.getbbox(text)[-2:])

Con you guys validate this?

This was reported in #282 and should have been fixed in 410b472. What you using development sources?

Oops! Sorry.

I'm using the development source but I did not pull since I did the installation a few weeks ago.
Closing