Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'FreeTypeFont' object has no attribute 'getsize' #66

Open
eikaramba opened this issue Jan 23, 2024 · 3 comments
Open

'FreeTypeFont' object has no attribute 'getsize' #66

eikaramba opened this issue Jan 23, 2024 · 3 comments

Comments

@eikaramba
Copy link

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

@robertknight
Copy link

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.

@luohao123
Copy link

Can u maek a PR to merge?

@ZiedChekir
Copy link

ZiedChekir commented Aug 21, 2024

I struggled with this problem so much and the problem was caused due pillow so I all i had to do is:

pip uninstall pillow -y
pip install "pillow==9.1.0"

Tested this on MacOs Ventura with python 3.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants