From 73bfc16bfdec3c8d1e5d7ba608bdab00ea182adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Sun, 3 Sep 2023 16:23:01 +0000 Subject: [PATCH] minor hiccups --- api/advent22_api/routers/_image.py | 5 +++-- api/advent22_api/routers/_misc.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/advent22_api/routers/_image.py b/api/advent22_api/routers/_image.py index 2ab3285..f238321 100644 --- a/api/advent22_api/routers/_image.py +++ b/api/advent22_api/routers/_image.py @@ -1,5 +1,6 @@ import colorsys from dataclasses import dataclass +from typing import Self import numpy as np from PIL import Image, ImageDraw, ImageFont @@ -10,7 +11,7 @@ class AdventImage: img: Image.Image @classmethod - async def load_standard(cls, fp) -> "AdventImage": + async def load_standard(cls, fp) -> Self: """ Bild laden und einen quadratischen Ausschnitt aus der Mitte nehmen @@ -33,7 +34,7 @@ class AdventImage: img = img.resize( size=(500, 500), - resample=Image.ANTIALIAS, + resample=Image.LANCZOS, ) # Farbmodell festlegen diff --git a/api/advent22_api/routers/_misc.py b/api/advent22_api/routers/_misc.py index 54a25eb..8437969 100644 --- a/api/advent22_api/routers/_misc.py +++ b/api/advent22_api/routers/_misc.py @@ -1,7 +1,7 @@ import itertools import random import re -from typing import Any, Sequence +from typing import Any, Self, Sequence from fastapi import Depends from PIL import ImageFont @@ -17,7 +17,7 @@ from ._image import AdventImage class Random(random.Random): @classmethod - async def get(cls, bonus_salt: Any = "") -> "Random": + async def get(cls, bonus_salt: Any = "") -> Self: cfg = await get_config() return cls(f"{cfg.puzzle.solution}{bonus_salt}")