1
0
Fork 0
mirror of https://github.com/Findus23/se-simulator.git synced 2024-09-19 15:53:45 +02:00

fix deprecated PIL function

This commit is contained in:
Lukas Winkler 2024-05-05 01:14:00 +02:00
parent 404864ac5a
commit 61359887b5
Signed by: lukas
GPG key ID: 54DE4D798D244853

View file

@ -189,7 +189,8 @@ def image(site_id=None):
img = Image.new("RGBA", (W, H), (site.background_color if site.background_color else "white")) img = Image.new("RGBA", (W, H), (site.background_color if site.background_color else "white"))
font = ImageFont.truetype(selected_font, font_size) font = ImageFont.truetype(selected_font, font_size)
draw = ImageDraw.Draw(img) draw = ImageDraw.Draw(img)
w, h = draw.multiline_textsize(text, font) left, top, right, bottom = draw.multiline_textbbox((0, 0), text, font)
w, h = right - left, bottom - top
draw.multiline_text(((W - w) / 2, (H - h) / 2), text, draw.multiline_text(((W - w) / 2, (H - h) / 2), text,
font=font, align="center", font=font, align="center",