Toten Code entfernen
Some checks failed
Build & Deploy / deploy (push) Failing after 11m38s

Ungenutzte Hilfsfunktion, ungenutzter Konfigurationswert und drei
CSS-Regeln ohne Verwendung im Markup.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Lucas Orth
2026-09-06 11:46:52 +02:00
parent ab993e98e1
commit 811dba4e98
4 changed files with 0 additions and 31 deletions

View File

@@ -79,13 +79,3 @@ def encode_jpeg(rgb_or_bgr: np.ndarray, quality: int = 88, bgr: bool = True) ->
Image.fromarray(array).save(buffer, format="JPEG", quality=quality, optimize=True)
return buffer.getvalue()
def fit_within(image: np.ndarray, max_edge: int) -> np.ndarray:
height, width = image.shape[:2]
longest = max(height, width)
if longest <= max_edge:
return image
scale = max_edge / longest
pil = Image.fromarray(image[:, :, ::-1])
pil = pil.resize((round(width * scale), round(height * scale)), Image.LANCZOS)
return np.asarray(pil)[:, :, ::-1].copy()