Zuschnitt als Regel statt als gespeichertes Bild

Die Sichtung merkt sich jetzt, WO der Vogel im Foto sitzt (vier Zahlen); die
Anzeige schneidet daraus bei jedem Aufruf. Eine geaenderte Regel wirkt damit
sofort auf den ganzen Bestand. Altbestand faellt auf das alte Bild zurueck.
This commit is contained in:
Artemis committed 2026-10-14 18:28:50 +00:00
1 parent f572c20080
commit d8d3efaa5d
14 files changed
+421 -19

No files matched your search

+8 -4
View File
@@ -136,9 +136,8 @@ def _art_kurz(request: HttpRequest, art: Species, eintrag: DexEntry | None) -> d
"zuletzt": eintrag.last_seen.isoformat(),
"neu": eintrag.is_new,
"foto": (
_bild(request, eintrag.best_sighting.crop)
or _bild(request, eintrag.best_sighting.image)
if eintrag.best_sighting
request.build_absolute_uri(eintrag.best_sighting.kachel_url)
if eintrag.best_sighting and eintrag.best_sighting.kachel_url
else None
),
}
@@ -189,7 +188,12 @@ def _sichtung_kurz(request: HttpRequest, s: Sighting) -> dict:
else None
),
"foto": _bild(request, s.image),
"ausschnitt": _bild(request, s.crop),
# 🔑 Der Ausschnitt wird aus dem Original gerechnet, nicht als
# zweites Bild gespeichert — siehe dex/zuschnitt.py. Damit schneidet
# eine geänderte Regel sofort den ganzen Bestand neu, und die App
# bekommt dieselbe Kachel wie die Website.
"ausschnitt": (request.build_absolute_uri(s.kachel_url)
if s.kachel_url else None),
}