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