Season hero photo as poster bg + switch to Alpine image #2

Merged
jschoubben merged 2 commits from feat/season-poster-bg into master 2026-06-14 15:42:50 +00:00
2 Commits
Author SHA1 Message Date
jschoubben 9430d499cc Map backgrounds (aerial/osm/dark/light), bbox zoom, world locator, kometa YAML endpoint
posters_service:
- BackgroundStyle enum + tile stitcher for race posters
  (Esri aerial / OSM Carto / CartoDB dark / CartoDB light / none)
- _resolve_circuit_geo: GeoJSON bbox centre + auto-zoom (no hand tuning),
  falls back to Jolpica lat/lon + f1-locations.json zoom
- _draw_track_projected: project the layout's GeoJSON points into the
  same window as the tile background, so the white outline aligns with
  the actual track (the hand-drawn SVGs had arbitrary orientations)
- _render_world_locator: 140x140 CartoDB Dark inset at zoom 5 with a
  red marker pinning the circuit on the continent
- _race_dark_overlay: dimming so the heading + footer stay legible
  against any underlying tiles
- render_kometa_metadata: emits a Kometa-compatible YAML covering
  every season 1950..current+1 with per-show + per-round url_poster

cdn-api:
- GET /posters/race/{name}/{year}.png supports ?bg= query param
- GET /kometa/formula-1-metadata.yml serves the generated config so
  Kometa pulls it via metadata_files.url (auto-updates with schedule)
2026-06-14 17:42:02 +02:00
jschoubben 99ac83c706 Use season hero photos as poster bg + switch image to Alpine
posters_service.render_season_poster() now fetches /dilbert/sports/
formula1/cars/{year}.jpg from the files-api CDN, centre-crops to 2:3,
and composites a vertical dark gradient so the FORMULA 1 / year /
WORLD CHAMPIONSHIP text stays legible over any photo.

Dockerfile:
  - python:3.12-slim → python:3.12-alpine (smaller, no fastf1 leftover)
  - fonts-dejavu-core → ttf-liberation: same font Arch dev ships, so
    posters render byte-identical on dev and in the container.
  - Drop fastf1 (unused in the served code path); add numpy explicitly
    because models/geo_json/geometry.py imports it at module load.
2026-06-13 22:42:16 +02:00