clovaai / synthtiger

Official Implementation of SynthTIGER (Synthetic Text Image Generator), ICDAR 2021

Home Page:https://clovaai.github.io/synthtiger/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'FreeTypeFont' object has no attribute 'getsize'

eikaramba opened this issue · comments

If anyone is experiencing the error above, this is because Pillow 10 deprecated the method. use getbbox instead. I have a fork ready with that, feel free to clone it and then do pip install ./myfork in the parent folder.

for proper support one could do this to support both versions

See Belval/TextRecognitionDataGenerator#323 for some notes on handling this change in a related project. The way Pillow recommends migrating getsize to getbbox in the official docs gives different output. The docs say getbbox returns (left, right, top, bottom) so you'd expect height = bottom - top, but actually to get the same output as before, just use the bottom coordinate.

Can u maek a PR to merge?