From 811dba4e98decc5f43e3122d79b790b9338fca20 Mon Sep 17 00:00:00 2001 From: Lucas Orth Date: Sun, 6 Sep 2026 11:46:52 +0200 Subject: [PATCH] Toten Code entfernen Ungenutzte Hilfsfunktion, ungenutzter Konfigurationswert und drei CSS-Regeln ohne Verwendung im Markup. Co-Authored-By: Claude Opus 5 --- .env.example | 2 -- app/config.py | 2 -- app/imaging.py | 10 ---------- static/style.css | 17 ----------------- 4 files changed, 31 deletions(-) diff --git a/.env.example b/.env.example index bc4bac3..07b62b7 100644 --- a/.env.example +++ b/.env.example @@ -25,8 +25,6 @@ SMTP_STARTTLS=1 REMINDER_TO= # --- Sonstiges -------------------------------------------------------------- -DATA_DIR=/data -PORT=8080 # Fuer den Link in der Erinnerungsmail. PUBLIC_BASE_URL=https://business-card-scanner.lucas-orth.de # Ortsnamen ueber Nominatim aufloesen (0 schaltet es ab). diff --git a/app/config.py b/app/config.py index 3f2b019..4f2a13f 100644 --- a/app/config.py +++ b/app/config.py @@ -25,8 +25,6 @@ DATA_DIR = Path(_s("DATA_DIR", "./data")) IMAGE_DIR = DATA_DIR / "images" DB_PATH = DATA_DIR / "cards.db" -PORT = _i("PORT", 8080) - # Leeres Passwort schaltet die Anmeldung ab - nur fuer die lokale Entwicklung. APP_PASSWORD = _s("APP_PASSWORD") SECRET_KEY = _s("SECRET_KEY", "dev-only-insecure-secret") diff --git a/app/imaging.py b/app/imaging.py index 7c55c25..61c92ea 100644 --- a/app/imaging.py +++ b/app/imaging.py @@ -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() diff --git a/static/style.css b/static/style.css index 1cd8c7b..d50894c 100644 --- a/static/style.css +++ b/static/style.css @@ -185,18 +185,6 @@ main { flex: 1; display: flex; flex-direction: column; } .btn:disabled { opacity: 0.35; cursor: not-allowed; } .btn .arrow { font-weight: 400; font-size: 17px; } -.btn-row { display: flex; gap: 10px; } -.btn-row .btn { flex: 1; } - -.btn-small { - padding: 9px 12px; - font-size: 11px; - letter-spacing: 0.1em; - border-width: 2px; - width: auto; - justify-content: center; -} - .btn-danger { border-color: var(--fg); color: var(--fg); } /* --------------------------------------------------------------------- Formular */ @@ -286,9 +274,6 @@ main { flex: 1; display: flex; flex-direction: column; } background: var(--wash); } -.thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; } -.thumbs img { width: 100%; border: 2px solid var(--fg); display: block; } - /* -------------------------------------------------------------------- Navigation */ .tabs { @@ -331,8 +316,6 @@ main { flex: 1; display: flex; flex-direction: column; } text-transform: uppercase; } -.badge-solid { background: var(--fg); color: var(--bg); } - .overlay { position: fixed; inset: 0;