minor hiccups

This commit is contained in:
Jörn-Michael Miehe 2023-09-03 16:23:01 +00:00
parent fb20275775
commit 73bfc16bfd
2 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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}")