coco-viewer icon indicating copy to clipboard operation
coco-viewer copied to clipboard

Issue: PIL deprecated the textsize() method in 10.0.0

Open goocy opened this issue 11 months ago • 0 comments

cocoviewer.py, line 183: tw, th = draw.textsize(text, font) PIL deprecated the textsize() method in 10.0.0: https://pillow.readthedocs.io/en/stable/releasenotes/10.0.0.html

Proposed fix:

x1, y1, x2, y2 = font.getbbox(text)
tw, th = (x2-x1, y2-y1)

goocy avatar Mar 05 '24 10:03 goocy