Pillow 10 removes 'getsize' from 'FreeTypeFont'
juliomateoslangerak opened this issue · comments
Julio Mateos Langerak commented
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?
David Miguel Susano Pinto commented
Julio Mateos Langerak commented
Oops! Sorry.
I'm using the development source but I did not pull since I did the installation a few weeks ago.
Closing