diff --git a/core/utils.py b/core/utils.py index 7e987e8..48eb802 100644 --- a/core/utils.py +++ b/core/utils.py @@ -58,8 +58,9 @@ def text_to_image(text, width, height) -> Image: img = Image.new('RGB', (width, height), color=(0, 209, 178)) d = ImageDraw.Draw(img) fnt = ImageFont.truetype(FONT_PATH, 30) - w, h = d.textsize(text, font=fnt) - d.text(((width-w)/2, (height-h)/2), text, font=fnt, align="center", fill=(255, 255, 255)) + w = d.textlength(text, font=fnt) + h=10 + d.text(((width-w)/2, h), text, font=fnt, align="center", fill=(255, 255, 255)) return img diff --git a/requirements.txt b/requirements.txt index a5bf7b3..968ffdb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ django==4.2.7 -Pillow==9.5.0 -psycopg2-binary==2.8.6 +Pillow==10.1.0 +psycopg2-binary==2.9.9 django-leaflet==0.29.0 black django-widget-tweaks==1.4.8