From e78992cfff32c48d08b6627e3a775456063f8c36 Mon Sep 17 00:00:00 2001 From: rasmus Date: Thu, 25 Jan 2024 09:37:51 +0100 Subject: [PATCH] repalced draw.textsize(text, font) with font.getbbox(text) as the former function is depricated --- cocoviewer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cocoviewer.py b/cocoviewer.py index 470a4be..b54d555 100644 --- a/cocoviewer.py +++ b/cocoviewer.py @@ -180,7 +180,8 @@ def draw_bboxes(draw, objects, labels, obj_categories, ignore, width, label_size # TODO: Implement notification message as popup window font = ImageFont.load_default() - tw, th = draw.textsize(text, font) + + notused_, notused_b_, tw, th = font.getbbox(text) tx0 = b[0] ty0 = b[1] - th