Skip to content

Issue: PIL deprecated the textsize() method in 10.0.0 #74

@goocy

Description

@goocy

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions