From a01e8c8a8ab0157935d29d42ccbdc01b51f7391c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Fri, 14 Oct 2022 23:38:37 +0000 Subject: [PATCH] vars eliminieren --- api/advent22_api/routers/days.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/api/advent22_api/routers/days.py b/api/advent22_api/routers/days.py index 5a27efc..80112a1 100644 --- a/api/advent22_api/routers/days.py +++ b/api/advent22_api/routers/days.py @@ -93,18 +93,13 @@ async def get_picture_for_day( Bild für einen Tag erstellen """ - # Font laden - font = ImageFont.truetype("Lena.ttf", 50) - - # Position des Buchstaben bestimmen rnd = await get_rnd(index) - xy = tuple(rnd.choices(range(30, 470), k=2)) - # betroffenen Bildbereich bestimmen + # Buchstabe verstecken await adv_img.hide_text( - xy=xy, + xy=tuple(rnd.choices(range(30, 470), k=2)), text=letter, - font=font, + font=ImageFont.truetype("Lena.ttf", 50), ) # Bilddaten in Puffer laden