From f6b9f937d09a3b79b2312af5bfd290c7408b20fb Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 30 Nov 2026 11:33:45 +0100 Subject: [PATCH 1/4] Write the lead's answers on the season photos into the design The season photos are matched to the operator's curated cars (77 seasons, 1950-2026), and the picks raised questions the design did not answer. The lead's answers of 2026-11-30: - Season posters: each season's photo is matched to the curated car of that season, in order the same car, the same model in a livery it raced that season, the same team's car of that season, that season's champion car; a curated photo of another year's car gives way to that season's car; the table of picks, seasons/picks.md, names the match per season. - Picking photos: tools/commons_candidates.py lists a season's candidates from its " Formula One season cars" category; where that category holds no free photo of the curated car, the person or session picking searches Commons for that car by name, and the pick's row in seasons/picks.md says so (no part runs the search: every season is picked). - An entry's date is when the photo was taken. Where the date Commons gives cannot be (a scan, an upload, a camera clock never set, a date after the file's upload), the date its description or category gives, marked "date_from"; where neither says, the month of the file's upload, the latest it can have been taken, marked "upload" (a true bound, not a date nobody measured). - The ported CC BY-SA licences (2.0 de, 3.0 de, 3.0 nl) are free like their unported versions and give the picture CC BY-SA 4.0; the licences list names them, and 2.5 beside 2.0 and 3.0 (it also allows a later version with the same elements). - Finished images: a finished picture's key also names the credit of each layer drawn from a pick, so a pick's changed credit makes a new key (principle 2: a changed input makes a new key). - What clients keep: the address carries an address version of its own (?v=), separate from the render version that keys kept layers and finished pictures; raised when a look changes, so clients load it again from the pictures already kept. Raised now to a1 because every season poster changed; the render version stays r3. The season photos leave "Not in this change". Claude-Session: https://claude.ai/code/session_01JG73KFhbaNj3tyJ8tKmE3W --- docs/posters.md | 51 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/docs/posters.md b/docs/posters.md index fe79229..65b1588 100644 --- a/docs/posters.md +++ b/docs/posters.md @@ -74,15 +74,19 @@ points (`tests/test_traces.py`). Layers live in the module's directory `layers`, ## Finished images (kept, capped) -Every finished picture is stored under a key made of its route, its resolved options and the keys of the layers -it was made from, in the directory `posters`, class `cache`, at most 2 GB; the least recently used go first when -it is full. A picture whose layer did not arrive is not stored. The render version is `r3`: no poster stored -before it is served again. +Every finished picture is stored under a key made of its route, its resolved options, the keys of the layers it was +made from, and the credit of each layer drawn from a pick, in the directory `posters`, class `cache`, at most 2 GB; +the least recently used go first when it is full. A picture whose layer did not arrive is not stored. The render +version is `r3`: no poster stored before it is served again. -**What clients keep.** An address that carries the render version (`?v=r3`, as the Kometa file writes it) is -sent `Cache-Control: public, max-age=31536000, immutable`. Any other address is sent an ETag and -`max-age=86400`, and a matching `If-None-Match` (weak or strong) gets a 304. A picture served without its layer -is sent `max-age=300` and no ETag. +**What clients keep.** The address clients are given carries an address version of its own (`?v=a1`, as the +Kometa file writes it), separate from the render version that keys kept layers and finished pictures. The address +version is raised when a look changes, so clients load it again from the pictures already kept; the render version +is raised only when the drawing itself changes. The address version was raised to `a1` (from `r3`, the render +version the addresses carried before) because every season poster changed; the render version stays `r3`. +An address that carries the address version is sent `Cache-Control: public, max-age=31536000, immutable`. Any +other address is sent an ETag and `max-age=86400`, and a matching `If-None-Match` (weak or strong) gets a 304. A +picture served without its layer is sent `max-age=300` and no ETag. ## Options @@ -124,11 +128,18 @@ Commons photo; until one is picked, it is drawn without a photo. Photos without the operator's earlier, hand-curated season photos carry agency credits (Getty Images, Motorsport Images/LAT and others) and stay private, as the reference for finding a freely licensed photo of the same car. +**Each season's photo is matched to the operator's curated car of that season**, in this order: the same car; the +same model in a livery it raced that season; the same team's car of that season; that season's champion car. A +curated photo of another year's car gives way to that season's car. The table of picks, `seasons/picks.md`, names +the match per season. + ## Picking photos `tools/commons_candidates.py` lists candidates from Commons per layout (aerial photos of the circuit dated in the -layout's years) and per season (that season's cars): only CC0, public domain, CC BY and CC BY-SA; quality marks, -size and landscape first; written to `examples/data/candidates.json`. The picker page shows, per layout, the +layout's years) and per season (the photos in its " Formula One season cars" category): only CC0, public +domain, CC BY and CC BY-SA; quality marks, size and landscape first; written to `examples/data/candidates.json`. +Where a season's category holds no free photo of the curated car, the person or session picking searches Commons for +that car by name, and the pick's row in `seasons/picks.md` says so. The picker page shows, per layout, the `bg=satellite` decision first (the national photo and EOX next to each other; keep the satellite, or use the map instead), then the optional photo candidates for `bg=photo`, beside the picks of the circuit's other layouts; per season, its candidates beside the nearest seasons' picks. It gives the entry to copy; it writes nothing. @@ -139,6 +150,13 @@ An entry holds the photo fields (`file`, the Commons title without "File:"; `lic `date`, `YYYY[-MM[-DD]]`), `"use": "map"`, or both. A key starting with `$` is a note and is skipped. Refused and logged when read: an unknown `use`, incomplete photo fields, an entry with neither, a licence that is not free. +An entry's `date` is when the photo was taken. Where the date Commons gives cannot be when the photo was taken (a +scan, an upload, a camera clock that was never set, a date after the file's upload), it is the date the file's +description or category gives, and the entry is marked `"date_from"`: `"description"` or `"category"`. Where neither +says when the photo was taken, it is the month of the file's upload, the latest it can have been taken, marked +`"date_from": "upload"`. The ported CC BY-SA licences (2.0 de, 3.0 de, 3.0 nl) are free like their unported versions +and give the picture CC BY-SA 4.0. + The API serves both files, read-only, as the poster service has them loaded: `/picks/circuits.json` and `/picks/seasons.json` answer the notes first, then the entries it draws from (a refused entry is left out), with the CORS of every route and, like the other JSON routes, no `Cache-Control`; the root route lists both. The picker reads the picks @@ -150,11 +168,11 @@ else a failure says which address failed and why. - On every picture: the credit line of each source it was made from, joined with " · ", at least 12 px high after scaling, wrapping when needed, on a dark band above the bottom strip. -- **A picture's licence follows its sources:** CC BY-SA 4.0 when made from a CC BY-SA photo (2.0, 3.0 and - 3.0 DE allow a later version with the same elements); CC BY-NC-SA 4.0 when made from EOX's mosaic; CC BY 4.0 - otherwise. Jolpica's race names and dates are single facts and do not set it. The satellite chain takes one - source, so a BY-SA photo and an NC-SA mosaic never meet on one picture; a picture that would combine them is - refused. +- **A picture's licence follows its sources:** CC BY-SA 4.0 when made from a CC BY-SA photo (2.0, 2.5, 3.0 + and the ported 2.0 DE, 3.0 DE and 3.0 NL allow a later version with the same elements); CC BY-NC-SA 4.0 when made + from EOX's mosaic; CC BY 4.0 otherwise. Jolpica's race names and dates are single facts and do not set it. The + satellite chain takes one source, so a BY-SA photo and an NC-SA mosaic never meet on one picture; a picture that + would combine them is refused. - In every picture's response: `X-Credits` (the credit line folded to ASCII: ß→ss, æ→ae, ø→o, œ→oe, đ→d, then accents dropped, "©" as "(c)", sources joined with " | "), `X-License`, and `Link: ; rel="license"`; CORS exposes them and the ETag. @@ -168,5 +186,4 @@ else a failure says which address failed and why. The disk tile store (replaced by kept layers); renaming the service away from "F1"; the three layouts whose trace is empty (Mont-Tremblant 1968-1970, Buddh 2011-2013, Yeongam 2010-2013), Bahrain's trace that sits off its real -track, and Donington's, a copy of Aintree's trace (traced separately); the season photos matched to the -operator's curated cars. +track, and Donington's, a copy of Aintree's trace (traced separately). -- 2.54.0 From ab0c4b9244d1645f161538cb9fad95d3b3a042b9 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 30 Nov 2026 11:30:31 +0100 Subject: [PATCH 2/4] Join the season photo picks: every season from 1950 to 2026 matched to its curated car seasons/photos.json held only its note, so every season poster was drawn without a photo. It now holds the 77 picks made by the curated car of each season (three runs: 1950-1975, 1976-2000, 2001-2026), keyed in year order. Licence, author and date of each were read from Commons' own metadata. Where that date cannot be when the photo was taken, the entry says where its date comes from: 1978, 1984, 1988 and 1991 from the description (Commons gives a scan or upload date); 1989 the upload's month, 2012-08 (Commons' 2013-08-21 is the camera's clock, after the upload of 2012-08-28, and neither the description, whose 1989 is the car's year, nor a category says when it was taken). 1967's author is the photographer as Commons names him on his other files, "edvvc from London, UK", without the uploader Commons' Artist field appends. The $comment says where a candidate comes from, the match order and date_from's three values. seasons/picks.md is the table of picks the design names: one row per season, newest first, the curated car named and described (never its photo, never where it is kept), the picked file, its licence, the match and why, joined from the three runs' tables. 1957, 1975 and 1977 are not in their season's cars category (searched as the candidates tool searches it, and their own categories walked up): their rows say they were found by a search for the car by name. Five seasons are not the same car: 1952 (the champion's car), 1967, 2023 and 2026 (the same team's car of that season), 1971 (the same model in the livery it raced that season). The tests read both files as the service does: every season 1950-2026 written in year order and accepted by poster_sources' reader, each date_from one of the design's three; the table names every picked season newest first, with the file and licence of seasons/photos.json and one of the design's four matches (on master both fail: no season is picked, no table). The licence test gains CC BY-SA 2.5 and the three ported licences the picks use (2.0 de, 3.0 de, 3.0 nl): free, and the picture CC BY-SA 4.0; pick_share's docstring names them. The reader does not check date_from, so it needs no change for "upload". Builds: docs/posters.md at f6b9f937d09a3b79b2312af5bfd290c7408b20fb (Season posters: each season's photo is matched to the curated car, the table of picks seasons/picks.md; Picking photos: the name search said in the pick's row, date and date_from, the ported CC BY-SA licences; Licences, stated: 2.5 and the ported licences) Claude-Session: https://claude.ai/code/session_01JG73KFhbaNj3tyJ8tKmE3W --- poster_sources.py | 3 +- seasons/photos.json | 546 +++++++++++++++++++++++++++++++++++++++++- seasons/picks.md | 90 +++++++ tests/test_posters.py | 26 ++ 4 files changed, 663 insertions(+), 2 deletions(-) create mode 100644 seasons/picks.md diff --git a/poster_sources.py b/poster_sources.py index 58add87..126417a 100644 --- a/poster_sources.py +++ b/poster_sources.py @@ -273,7 +273,8 @@ def pick_credit(pick: dict) -> str: def pick_share(pick: dict) -> Optional[str]: - """A CC BY-SA photo (2.0, 3.0, 3.0 DE, 4.0: each allows a later version) makes its picture CC BY-SA 4.0.""" + """A CC BY-SA photo (2.0, 2.5, 3.0, 4.0 and the ported 2.0 DE, 3.0 DE, 3.0 NL: each allows a later version) + makes its picture CC BY-SA 4.0.""" return BY_SA if re.match(r"^CC[- ]BY-SA\b", (pick.get("licence") or "").strip(), re.IGNORECASE) else None diff --git a/seasons/photos.json b/seasons/photos.json index 8780078..49ce577 100644 --- a/seasons/photos.json +++ b/seasons/photos.json @@ -1,3 +1,547 @@ { - "$comment": "The picked Wikimedia Commons photo per season, from the \" Formula One season cars\" category (docs/posters.md, Season posters and Picking photos). Key: the year, such as \"2024\". Value: {\"file\": the Commons title without \"File:\", \"licence\": its LicenseShortName (CC0, public domain, CC BY or CC BY-SA only), \"author\", \"credit\": \"Photo: , , via Wikimedia Commons\", \"date\": YYYY[-MM[-DD]]}. Written by the picking tool, read by the poster service; a key starting with \"$\" is a note, not a pick." + "$comment": "The picked Wikimedia Commons photo per season, matched to the operator's curated car of that season (docs/posters.md, Season posters and Picking photos; the match per season is in seasons/picks.md). A candidate comes from the \" Formula One season cars\" category or from a search for the curated car by name; the match, in order: the same car, the same model in a livery it raced that season, the same team's car of that season, that season's champion car. Key: the year, such as \"2024\". Value: {\"file\": the Commons title without \"File:\", \"licence\": its LicenseShortName (CC0, public domain, CC BY or CC BY-SA only), \"author\", \"credit\": \"Photo: , , via Wikimedia Commons\", \"date\": YYYY[-MM[-DD]], when the photo was taken, and, where the date Commons gives cannot be, \"date_from\": \"description\" or \"category\", where the date was read instead, or \"upload\", the month of the file's upload where neither says}. Written by the picking tool, read by the poster service; a key starting with \"$\" is a note, not a pick.", + "1950": { + "file": "Galleria Ferrari (9) (3955971032).jpg", + "licence": "CC BY-SA 2.0", + "author": "János Korom Dr. >11 Million views from Wien, Austria", + "credit": "Photo: János Korom Dr. >11 Million views from Wien, Austria, CC BY-SA 2.0, via Wikimedia Commons", + "date": "2002-04-13" + }, + "1951": { + "file": "Ferrari 212 F1.jpg", + "licence": "CC BY 2.0", + "author": "andy carter from England", + "credit": "Photo: andy carter from England, CC BY 2.0, via Wikimedia Commons", + "date": "2008-08-31" + }, + "1952": { + "file": "Grote Prijs Nederlandse autoraces Zandvoort. Finish Askari, Bestanddeelnr 905-2692.jpg", + "licence": "CC0", + "author": "Joop van Bilsen / Anefo", + "credit": "Photo: Joop van Bilsen / Anefo, CC0, via Wikimedia Commons", + "date": "1952-08-17" + }, + "1953": { + "file": "Goodwood Festival of Speed 2024 (54254822116).jpg", + "licence": "CC BY 2.0", + "author": "Mark from Brighton", + "credit": "Photo: Mark from Brighton, CC BY 2.0, via Wikimedia Commons", + "date": "2024-07-12" + }, + "1954": { + "file": "Großer Preis von Europa -1954 Nürburgring, Juan Manuel Fangio, Mercedes (3)x.JPG", + "licence": "CC BY-SA 3.0", + "author": "Agridecumantes", + "credit": "Photo: Agridecumantes, CC BY-SA 3.0, via Wikimedia Commons", + "date": "1954-08-01" + }, + "1955": { + "file": "Goodwood Festival of Speed 2015 (26733252225).jpg", + "licence": "CC BY-SA 2.0", + "author": "christianb_7", + "credit": "Photo: christianb_7, CC BY-SA 2.0, via Wikimedia Commons", + "date": "2015-06-28" + }, + "1956": { + "file": "Lancia D50 of Scuderia Ferrari.jpg", + "licence": "CC BY 2.0", + "author": "Simon Davison from Los Gatos, United States", + "credit": "Photo: Simon Davison from Los Gatos, United States, CC BY 2.0, via Wikimedia Commons", + "date": "2006-08-19" + }, + "1957": { + "file": "1957 Maserati 250F (54834214403).jpg", + "licence": "CC BY 4.0", + "author": "David Merrett from Daventry, England", + "credit": "Photo: David Merrett from Daventry, England, CC BY 4.0, via Wikimedia Commons", + "date": "2025-08-22" + }, + "1958": { + "file": "1958 Ferrari Dino 246 (54834214458).jpg", + "licence": "CC BY 4.0", + "author": "David Merrett from Daventry, England", + "credit": "Photo: David Merrett from Daventry, England, CC BY 4.0, via Wikimedia Commons", + "date": "2025-08-22" + }, + "1959": { + "file": "Autoraces op het circuit van Zandvoort van de Grand Prix Stirling Moss (no.11) t, Bestanddeelnr 910-4129.jpg", + "licence": "CC0", + "author": "Harry Pot / Anefo", + "credit": "Photo: Harry Pot / Anefo, CC0, via Wikimedia Commons", + "date": "1959-05-31" + }, + "1960": { + "file": "Millers at Milwaukee 2026 061 (1960 Scarab Formula 1 No. 48).jpg", + "licence": "CC BY-SA 4.0", + "author": "Michael Barera", + "credit": "Photo: Michael Barera, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2026-07-11" + }, + "1961": { + "file": "Von Trips and P. Hill at 1961 Dutch Grand Prix.jpg", + "licence": "CC BY-SA 3.0 nl", + "author": "Harry Pot", + "credit": "Photo: Harry Pot, CC BY-SA 3.0 nl, via Wikimedia Commons", + "date": "1961-05-22" + }, + "1962": { + "file": "Porsche 804 Solitude Revival 2022 1X7A0078.jpg", + "licence": "CC BY-SA 4.0", + "author": "Alexander Migl", + "credit": "Photo: Alexander Migl, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2022-07-17" + }, + "1963": { + "file": "1963 Lotus 25 R4 (54833107267).jpg", + "licence": "CC BY 4.0", + "author": "David Merrett from Daventry, England", + "credit": "Photo: David Merrett from Daventry, England, CC BY 4.0, via Wikimedia Commons", + "date": "2025-08-22" + }, + "1964": { + "file": "John Surtees Ferrari 158 at Goodwood 2014 001.jpg", + "licence": "CC BY-SA 2.0", + "author": "Nic Redhead", + "credit": "Photo: Nic Redhead, CC BY-SA 2.0, via Wikimedia Commons", + "date": "2014-06-29" + }, + "1965": { + "file": "Honda RA272 (Hikaru Miyagi).jpg", + "licence": "CC BY 2.0", + "author": "Norimasa Hayashida", + "credit": "Photo: Norimasa Hayashida, CC BY 2.0, via Wikimedia Commons", + "date": "2012-10-07" + }, + "1966": { + "file": "Brabham BT19, NSM, 2008 vertical.JPG", + "licence": "CC BY-SA 3.0", + "author": "Bahnfrend", + "credit": "Photo: Bahnfrend, CC BY-SA 3.0, via Wikimedia Commons", + "date": "2008-04-23" + }, + "1967": { + "file": "1967 Cooper-Maserati T86 191599250.jpg", + "licence": "CC BY 2.0", + "author": "edvvc from London, UK", + "credit": "Photo: edvvc from London, UK, CC BY 2.0, via Wikimedia Commons", + "date": "2006-07-09" + }, + "1968": { + "file": "Stewart, J., Matra MS10, 2. Rd 1968-08-04 v2.jpg", + "licence": "CC BY-SA 2.0 de", + "author": "Spurzem - Lothar Spurzem; Image modified by xavax", + "credit": "Photo: Spurzem - Lothar Spurzem; Image modified by xavax, CC BY-SA 2.0 de, via Wikimedia Commons", + "date": "1968-08-04" + }, + "1969": { + "file": "Jochen Rindt 1969 German GP.jpg", + "licence": "CC BY-SA 2.0 de", + "author": "Lothar Spurzem", + "credit": "Photo: Lothar Spurzem, CC BY-SA 2.0 de, via Wikimedia Commons", + "date": "1969-08-01" + }, + "1970": { + "file": "Rindt at 1970 Dutch Grand Prix.jpg", + "licence": "CC BY-SA 3.0 nl", + "author": "Evers, Joost / Anefo / neg. stroken, 1945-1989, 2.24.01.05, item number 923-6110", + "credit": "Photo: Evers, Joost / Anefo / neg. stroken, 1945-1989, 2.24.01.05, item number 923-6110, CC BY-SA 3.0 nl, via Wikimedia Commons", + "date": "1970-06-21" + }, + "1971": { + "file": "1971 Emerson Fittipaldi, Lotus 72 (kl).JPG", + "licence": "CC BY-SA 3.0 de", + "author": "Lothar Spurzem", + "credit": "Photo: Lothar Spurzem, CC BY-SA 3.0 de, via Wikimedia Commons", + "date": "1971" + }, + "1972": { + "file": "1972 Lotus 72D (54834288360).jpg", + "licence": "CC BY 4.0", + "author": "David Merrett from Daventry, England", + "credit": "Photo: David Merrett from Daventry, England, CC BY 4.0, via Wikimedia Commons", + "date": "2025-08-22" + }, + "1973": { + "file": "Ferrari 312B2 Jacky Ickx 2010 Canada.jpg", + "licence": "CC BY-SA 2.0", + "author": "Mark McArdle", + "credit": "Photo: Mark McArdle, CC BY-SA 2.0, via Wikimedia Commons", + "date": "2010-06-11" + }, + "1974": { + "file": "Franschhoek Motor Museum (30524452055).jpg", + "licence": "CC BY 2.0", + "author": "naeem mayet", + "credit": "Photo: naeem mayet, CC BY 2.0, via Wikimedia Commons", + "date": "2016-10-23" + }, + "1975": { + "file": "Jean-Pierre Jarier Shadow DN5 2019 Silverstone Classic (48557920447).jpg", + "licence": "CC BY 2.0", + "author": "https://www.flickr.com/photos/davehamster/", + "credit": "Photo: https://www.flickr.com/photos/davehamster/, CC BY 2.0, via Wikimedia Commons", + "date": "2019-07-26" + }, + "1976": { + "file": "James Hunt - McLaren M23 - 1976 Race of Champions, Brands Hatch.jpg", + "licence": "CC BY-SA 2.0", + "author": "Martin Lee", + "credit": "Photo: Martin Lee, CC BY-SA 2.0, via Wikimedia Commons", + "date": "1976-03-14" + }, + "1977": { + "file": "Jean-Pierre Jarier - Penske PC4 at Tabac at the 1977 Monaco GP.jpg", + "licence": "CC BY-SA 2.0", + "author": "Martin Lee", + "credit": "Photo: Martin Lee, CC BY-SA 2.0, via Wikimedia Commons", + "date": "1977-05-22" + }, + "1978": { + "file": "Riccardo Patrese - Arrows FA1 at Druids at the 1978 British Grand Prix (50050521097).jpg", + "licence": "CC BY-SA 2.0", + "author": "Martin Lee from London, UK", + "credit": "Photo: Martin Lee from London, UK, CC BY-SA 2.0, via Wikimedia Commons", + "date": "1978-07-16", + "date_from": "description" + }, + "1979": { + "file": "FoS20162016 0624 103601AA (27851813796).jpg", + "licence": "CC BY-SA 2.0", + "author": "Matthew Lamb", + "credit": "Photo: Matthew Lamb, CC BY-SA 2.0, via Wikimedia Commons", + "date": "2016-06-24" + }, + "1980": { + "file": "Ferrari 312T5 Gilles Villeneuve 2010 Canada 1.jpg", + "licence": "CC BY-SA 2.0", + "author": "Mark McArdle", + "credit": "Photo: Mark McArdle, CC BY-SA 2.0, via Wikimedia Commons", + "date": "2010-06-11" + }, + "1981": { + "file": "McLaren MP4 at Silverstone Classic 2011 (1).jpg", + "licence": "CC BY 2.0", + "author": "David Merrett from Daventry, England", + "credit": "Photo: David Merrett from Daventry, England, CC BY 2.0, via Wikimedia Commons", + "date": "2011-07-22" + }, + "1982": { + "file": "Rene Arnoux 1982 British GP.jpg", + "licence": "CC BY-SA 2.0", + "author": "Martin Lee", + "credit": "Photo: Martin Lee, CC BY-SA 2.0, via Wikimedia Commons", + "date": "1982-07-18" + }, + "1983": { + "file": "Renault RE40 (30428152663).jpg", + "licence": "CC BY-SA 2.0", + "author": "Alexandre Prévot from Nancy, France", + "credit": "Photo: Alexandre Prévot from Nancy, France, CC BY-SA 2.0, via Wikimedia Commons", + "date": "2016-02-03" + }, + "1984": { + "file": "Lotus 95T Classic-Days 2022 DSC 0141.jpg", + "licence": "CC BY-SA 4.0", + "author": "Alexander Migl", + "credit": "Photo: Alexander Migl, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2022", + "date_from": "description" + }, + "1985": { + "file": "1985 European GP Rosberg.jpg", + "licence": "CC BY-SA 2.0", + "author": "Jerry Lewis-Evans", + "credit": "Photo: Jerry Lewis-Evans, CC BY-SA 2.0, via Wikimedia Commons", + "date": "1985-10-04" + }, + "1986": { + "file": "Lotus 98T Donington 2007.jpg", + "licence": "CC BY 2.0", + "author": "Darren", + "credit": "Photo: Darren, CC BY 2.0, via Wikimedia Commons", + "date": "2007-09-09" + }, + "1987": { + "file": "Ferrari F187 (1987) (22031030520).jpg", + "licence": "CC BY-SA 2.0", + "author": "Takayuki Suzuki from Kanagawa, Japan", + "credit": "Photo: Takayuki Suzuki from Kanagawa, Japan, CC BY-SA 2.0, via Wikimedia Commons", + "date": "2015-09-27" + }, + "1988": { + "file": "Ayrton Senna in 1988.jpg", + "licence": "CC BY 2.0", + "author": "Instituto Ayrton Senna", + "credit": "Photo: Instituto Ayrton Senna, CC BY 2.0, via Wikimedia Commons", + "date": "1988", + "date_from": "description" + }, + "1989": { + "file": "Musée Lamborghini 0078.JPG", + "licence": "CC BY-SA 3.0", + "author": "Arnaud 25", + "credit": "Photo: Arnaud 25, CC BY-SA 3.0, via Wikimedia Commons", + "date": "2012-08", + "date_from": "upload" + }, + "1990": { + "file": "McLaren MP4-5B front-right Honda Collection Hall.jpg", + "licence": "CC BY-SA 3.0", + "author": "Morio", + "credit": "Photo: Morio, CC BY-SA 3.0, via Wikimedia Commons", + "date": "2012-07-16" + }, + "1991": { + "file": "Bertrand Gachot 1991 USA.jpg", + "licence": "CC BY 2.0", + "author": "Stuart Seeger from College Station, Texas, USA", + "credit": "Photo: Stuart Seeger from College Station, Texas, USA, CC BY 2.0, via Wikimedia Commons", + "date": "1991-03-10", + "date_from": "description" + }, + "1992": { + "file": "Ayrton Senna 1992 Monaco.jpg", + "licence": "CC BY 2.0", + "author": "Iwao from Tokyo, Japan", + "credit": "Photo: Iwao from Tokyo, Japan, CC BY 2.0, via Wikimedia Commons", + "date": "1992-05-28" + }, + "1993": { + "file": "Alain Prost - Williams FW15C during practice for the 1993 British Grand Prix (33557472711).jpg", + "licence": "CC BY-SA 2.0", + "author": "Martin Lee from London, UK", + "credit": "Photo: Martin Lee from London, UK, CC BY-SA 2.0, via Wikimedia Commons", + "date": "1993" + }, + "1994": { + "file": "Williams FW16 front 2017 Williams Conference Centre.jpg", + "licence": "CC BY-SA 4.0", + "author": "Morio", + "credit": "Photo: Morio, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2017-03-18" + }, + "1995": { + "file": "Benetton B195 front-left1 2019 Michael Schumacher Private Collection.jpg", + "licence": "CC BY-SA 4.0", + "author": "Morio", + "credit": "Photo: Morio, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2019-05-06" + }, + "1996": { + "file": "Rubens Barrichello - Imola 1996.jpg", + "licence": "CC BY-SA 4.0", + "author": "Restu20", + "credit": "Photo: Restu20, CC BY-SA 4.0, via Wikimedia Commons", + "date": "1996-05-03" + }, + "1997": { + "file": "Williams FW19 of Jacques Villeneuve, 1997.jpg", + "licence": "CC BY-SA 2.0", + "author": "Phil Guest", + "credit": "Photo: Phil Guest, CC BY-SA 2.0, via Wikimedia Commons", + "date": "2014-04-12" + }, + "1998": { + "file": "1998 F1 car Ferrari F300 Goodwood 2009.jpg", + "licence": "CC BY 2.0", + "author": "Brian Snelson from Hockley, Essex, England", + "credit": "Photo: Brian Snelson from Hockley, Essex, England, CC BY 2.0, via Wikimedia Commons", + "date": "2009-07-05" + }, + "1999": { + "file": "McLaren MP4-14, Mika Häkkinen (The Loh Collection) 2.jpg", + "licence": "CC BY 4.0", + "author": "MarcelBuehner", + "credit": "Photo: MarcelBuehner, CC BY 4.0, via Wikimedia Commons", + "date": "2024-05-02" + }, + "2000": { + "file": "Ferrari F1-2000, Michael Schumacher (53277830647).jpg", + "licence": "CC BY 2.0", + "author": "Thomas Vogt from Paderborn, Deutschland", + "credit": "Photo: Thomas Vogt from Paderborn, Deutschland, CC BY 2.0, via Wikimedia Commons", + "date": "2023-10-01" + }, + "2001": { + "file": "Minardi PS01 front 2017 Museo Fernando Alonso.jpg", + "licence": "CC BY-SA 4.0", + "author": "Morio", + "credit": "Photo: Morio, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2017-03-03" + }, + "2002": { + "file": "Ferrari F2002 front.jpg", + "licence": "CC BY 2.0", + "author": "pelican-actor", + "credit": "Photo: pelican-actor, CC BY 2.0, via Wikimedia Commons", + "date": "2022-04-29" + }, + "2003": { + "file": "Juan Pablo Montoya 2003 Silverstone 10.jpg", + "licence": "CC BY-SA 2.0", + "author": "Martin Lee", + "credit": "Photo: Martin Lee, CC BY-SA 2.0, via Wikimedia Commons", + "date": "2003-07-28" + }, + "2004": { + "file": "Renault R24 front 2017 Museo Fernando Alonso.jpg", + "licence": "CC BY-SA 4.0", + "author": "Morio", + "credit": "Photo: Morio, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2017-03-03" + }, + "2005": { + "file": "2005 Renault R25 (54834195219).jpg", + "licence": "CC BY 4.0", + "author": "David Merrett from Daventry, England", + "credit": "Photo: David Merrett from Daventry, England, CC BY 4.0, via Wikimedia Commons", + "date": "2025-08-22" + }, + "2006": { + "file": "F1 car McLarenMercedes 2006 2.jpg", + "licence": "CC BY-SA 2.5", + "author": "user:AngMoKio", + "credit": "Photo: user:AngMoKio, CC BY-SA 2.5, via Wikimedia Commons", + "date": "2006-11-07" + }, + "2007": { + "file": "Goodwood FOS 2008 (2661779792).jpg", + "licence": "CC BY 2.0", + "author": "Mark Woodbury from London, England", + "credit": "Photo: Mark Woodbury from London, England, CC BY 2.0, via Wikimedia Commons", + "date": "2008-07-11" + }, + "2008": { + "file": "Red Bull RB4 front Donington Grand Prix Collection.jpg", + "licence": "CC BY-SA 3.0", + "author": "Morio", + "credit": "Photo: Morio, CC BY-SA 3.0, via Wikimedia Commons", + "date": "2013-03-07" + }, + "2009": { + "file": "Nakajima 2009 Spain.jpg", + "licence": "CC BY 2.0", + "author": "Jose Mª Izquierdo Galiot", + "credit": "Photo: Jose Mª Izquierdo Galiot, CC BY 2.0, via Wikimedia Commons", + "date": "2009-05-08" + }, + "2010": { + "file": "Jenson Button 2010 Britain.jpg", + "licence": "CC BY 2.0", + "author": "First Stop from UK", + "credit": "Photo: First Stop from UK, CC BY 2.0, via Wikimedia Commons", + "date": "2010-07-09" + }, + "2011": { + "file": "Jenson Button 2011 Malaysia FP3.jpg", + "licence": "CC BY-SA 3.0", + "author": "Morio", + "credit": "Photo: Morio, CC BY-SA 3.0, via Wikimedia Commons", + "date": "2011-04-09" + }, + "2012": { + "file": "Mark Webber (7448977618).jpg", + "licence": "CC BY-SA 2.0", + "author": "Nic Redhead from Birmingham, UK", + "credit": "Photo: Nic Redhead from Birmingham, UK, CC BY-SA 2.0, via Wikimedia Commons", + "date": "2012-06-09" + }, + "2013": { + "file": "16 Maldonado (9186376054).jpg", + "licence": "CC BY 2.0", + "author": "Steven Jones", + "credit": "Photo: Steven Jones, CC BY 2.0, via Wikimedia Commons", + "date": "2013-06-28" + }, + "2014": { + "file": "Lewis Hamilton 2014 Singapore Race(L02).jpg", + "licence": "CC BY-SA 4.0", + "author": "Morio", + "credit": "Photo: Morio, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2014-09-21" + }, + "2015": { + "file": "Sebastian Vettel 2015 Malaysia FP2 3.jpg", + "licence": "CC BY-SA 4.0", + "author": "Morio", + "credit": "Photo: Morio, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2015-03-27" + }, + "2016": { + "file": "F1 - Renault - Kevin Magnussen (28582684145).jpg", + "licence": "CC BY 2.0", + "author": "Jen_ross83", + "credit": "Photo: Jen_ross83, CC BY 2.0, via Wikimedia Commons", + "date": "2016-07-08" + }, + "2017": { + "file": "Ferrari SF70H Vettel Barcelona Test.jpg", + "licence": "CC BY-SA 2.0", + "author": "Artes Max from Spain", + "credit": "Photo: Artes Max from Spain, CC BY-SA 2.0, via Wikimedia Commons", + "date": "2017-02-27" + }, + "2018": { + "file": "FIA F1 Austria 2018 Nr. 16 Leclerc.jpg", + "licence": "CC BY-SA 4.0", + "author": "Lukas Raich", + "credit": "Photo: Lukas Raich, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2018-06-29" + }, + "2019": { + "file": "Lewis Hamilton's 2019 Mercedes AMG Petronas Motorsport M10 Formula 1 Car (49379927706).jpg", + "licence": "CC BY 2.0", + "author": "David Merrett from Daventry, England", + "credit": "Photo: David Merrett from Daventry, England, CC BY 2.0, via Wikimedia Commons", + "date": "2020-01-11" + }, + "2020": { + "file": "Max Verstappen, 2020 pre-season testing (2).jpg", + "licence": "CC BY 2.0", + "author": "Jen Ross", + "credit": "Photo: Jen Ross, CC BY 2.0, via Wikimedia Commons", + "date": "2020-02-21" + }, + "2021": { + "file": "FIA F1 Austria 2021 Nr. 5 Vettel.jpg", + "licence": "CC BY-SA 4.0", + "author": "Lukas Raich", + "credit": "Photo: Lukas Raich, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2021-07-02" + }, + "2022": { + "file": "FIA F1 Austria 2022 Nr. 1 Verstappen.jpg", + "licence": "CC BY-SA 4.0", + "author": "Lukas Raich", + "credit": "Photo: Lukas Raich, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2022-07-08" + }, + "2023": { + "file": "FIA F1 Austria 2023 Nr. 4 (2).jpg", + "licence": "CC BY-SA 4.0", + "author": "Lukas Raich", + "credit": "Photo: Lukas Raich, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2023-06-30" + }, + "2024": { + "file": "2024-08-25 Motorsport, Formel 1, Großer Preis der Niederlande 2024 STP 3923 by Stepro.jpg", + "licence": "CC BY-SA 4.0", + "author": "Steffen Prößdorf", + "credit": "Photo: Steffen Prößdorf, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2024-08-25" + }, + "2025": { + "file": "FIA F1 Imola 2025 No. 81 Piastri (3) (cropped).jpg", + "licence": "CC BY 4.0", + "author": "Jen_ross83", + "credit": "Photo: Jen_ross83, CC BY 4.0, via Wikimedia Commons", + "date": "2025-05-16" + }, + "2026": { + "file": "2026-08-21 Motorsport, Formel 1, Großer Preis der Niederlande 2026 STP 2266.jpg", + "licence": "CC BY-SA 4.0", + "author": "Steffen Prößdorf", + "credit": "Photo: Steffen Prößdorf, CC BY-SA 4.0, via Wikimedia Commons", + "date": "2026-08-21" + } } diff --git a/seasons/picks.md b/seasons/picks.md new file mode 100644 index 0000000..c2ec89f --- /dev/null +++ b/seasons/picks.md @@ -0,0 +1,90 @@ +# The table of picks: the season photos + +The photo each season poster draws (`seasons/photos.json`) and how it matches the operator's curated car of that +season (docs/posters.md, Season posters). The match, in order: `same car`; `same model, other livery` (the same model +in a livery it raced that season); `same team and season` (the same team's car of that season); `champion` (that +season's champion car). A curated photo of another year's car gives way to that season's car. The curated photos +are a private reference: a row names and describes the curated car, never its photo. Licence, author and date of +each pick were read from Commons' own metadata. + +Matches: same car 72; same model, other livery 1; same team and season 3; champion 1 (of 77 seasons). + +| Year | Curated car | Picked file | Licence | Match | Why | +|:---|:---|:---|:---|:---|:---| +| 2026 | Red Bull with Honda power, #1 (a 2022-2025 car), Bahrain | 2026-08-21 Motorsport, Formel 1, Großer Preis der Niederlande 2026 STP 2266.jpg | CC BY-SA 4.0 | same team and season | The curated car is a pre-2026 Red Bull (Honda on the engine cover; Red Bull runs Ford power in 2026). The lead's answer: Red Bull's 2026 car instead, here Verstappen's RB22. Commons marks the file with a personality-rights notice. | +| 2025 | McLaren MCL39 #81, Oscar Piastri, night race | FIA F1 Imola 2025 No. 81 Piastri (3) (cropped).jpg | CC BY 4.0 | same car | Piastri's #81 MCL39 from the front three-quarters (MCL38 and MCL39 look alike; the operator's year holds). | +| 2024 | Red Bull (Verstappen) beside Aston Martin #14 (Fernando Alonso), Jeddah at night | 2024-08-25 Motorsport, Formel 1, Großer Preis der Niederlande 2024 STP 3923 by Stepro.jpg | CC BY-SA 4.0 | same car | Verstappen's RB20 head-on, the nearer of the two curated cars in the curated view. The 2023 and 2024 liveries are too alike to read the photo's year, so the operator's year holds. Commons marks the file with a personality-rights notice. | +| 2023 | McLaren MCL36 (2022 car), Lando Norris, Interlagos | FIA F1 Austria 2023 Nr. 4 (2).jpg | CC BY-SA 4.0 | same team and season | The curated photo shows a 2022 car: the 2022 São Paulo photos on Commons show the same livery (papaya with a blue band, Darktrace wing), while the 2023 MCL60 is darker with Chrome on the sidepods. By the lead's rule, McLaren's 2023 car instead: Norris's MCL60. | +| 2022 | Red Bull RB18 #1, Max Verstappen, Barcelona | FIA F1 Austria 2022 Nr. 1 Verstappen.jpg | CC BY-SA 4.0 | same car | Verstappen's #1 RB18 from the front three-quarters, the curated view. | +| 2021 | Aston Martin AMR21 #5, Sebastian Vettel, Monaco | FIA F1 Austria 2021 Nr. 5 Vettel.jpg | CC BY-SA 4.0 | same car | Vettel's #5 AMR21 at speed, Cognizant sidepod and helmet in the crop. | +| 2020 | Red Bull RB16 #33, Max Verstappen | Max Verstappen, 2020 pre-season testing (2).jpg | CC BY 2.0 | same car | Verstappen's RB16; the better-framed RB16 photo is Albon's car. | +| 2019 | Mercedes W10 #44, Lewis Hamilton, Melbourne | Lewis Hamilton's 2019 Mercedes AMG Petronas Motorsport M10 Formula 1 Car (49379927706).jpg | CC BY 2.0 | same car | Hamilton's own W10 head-on with its #44 nose (the title says "M10"; the car is the W10). | +| 2018 | Sauber C37 #16, Charles Leclerc (McLaren MCL33 #14 behind), Suzuka | FIA F1 Austria 2018 Nr. 16 Leclerc.jpg | CC BY-SA 4.0 | same car | Leclerc's #16 C37 with the Alfa Romeo engine cover; the Sauber is the curated photo's subject in front. | +| 2017 | Ferrari SF70H #5, Sebastian Vettel | Ferrari SF70H Vettel Barcelona Test.jpg | CC BY-SA 2.0 | same car | Vettel's SF70H from the front three-quarters, the curated view. | +| 2016 | Renault R.S.16 #20, Kevin Magnussen, Singapore | F1 - Renault - Kevin Magnussen (28582684145).jpg | CC BY 2.0 | same car | Magnussen's #20 R.S.16, whole in the crop. | +| 2015 | Ferrari SF15-T, Sebastian Vettel, Spa | Sebastian Vettel 2015 Malaysia FP2 3.jpg | CC BY-SA 4.0 | same car | Vettel's SF15-T: helmet, sidepod and front wheel in the crop. | +| 2014 | Mercedes F1 W05 Hybrid #44, Lewis Hamilton, head-on | Lewis Hamilton 2014 Singapore Race(L02).jpg | CC BY-SA 4.0 | same car | Hamilton's W05 head-on, the curated view. | +| 2013 | Williams FW35 #16, Pastor Maldonado, Jerez test | 16 Maldonado (9186376054).jpg | CC BY 2.0 | same car | Maldonado's #16 FW35 with its PDVSA livery. | +| 2012 | Red Bull RB8, Mark Webber, Barcelona | Mark Webber (7448977618).jpg | CC BY-SA 2.0 | same car | Webber's RB8 at speed; cockpit, helmet and Red Bull sidepod in the crop. | +| 2011 | McLaren MP4-26, Jenson Button | Jenson Button 2011 Malaysia FP3.jpg | CC BY-SA 3.0 | same car | Button's MP4-26 head-on with the Vodafone wing; 1600x923, upscaled 1.6x. | +| 2010 | McLaren MP4-25, Jenson Button | Jenson Button 2010 Britain.jpg | CC BY 2.0 | same car | Button in the MP4-25, helmet, cockpit and Vodafone wing filling the crop. | +| 2009 | Williams FW31 #17, Kazuki Nakajima, Barcelona | Nakajima 2009 Spain.jpg | CC BY 2.0 | same car | The curated photo is this Commons file itself (same picture, compared pixel by pixel at reduced size); taken exactly. 1416x852, upscaled 1.76x. | +| 2008 | Red Bull RB4 #10, Mark Webber | Red Bull RB4 front Donington Grand Prix Collection.jpg | CC BY-SA 3.0 | same car | The RB4 head-on, square 2560x2560, so almost the whole car stays in the crop. | +| 2007 | Ferrari F2007, Kimi Raikkonen | Goodwood FOS 2008 (2661779792).jpg | CC BY 2.0 | same car | An F2007 from the front three-quarters, whole in the crop; Raikkonen's own race photos on Commons are 637 to 1034 px wide. | +| 2006 | McLaren MP4-21 (Emirates, Siemens, Johnnie Walker), white and red helmet (Kimi Raikkonen) | F1 car McLarenMercedes 2006 2.jpg | CC BY-SA 2.5 | same car | The MP4-21 head-on, centred; its sponsors match the curated car's. | +| 2005 | Renault R25, Fernando Alonso | 2005 Renault R25 (54834195219).jpg | CC BY 4.0 | same car | The #5 R25 (Alonso's number) head-on, portrait, 3511x4037. | +| 2004 | Renault R24 #8, Fernando Alonso, Magny-Cours | Renault R24 front 2017 Museo Fernando Alonso.jpg | CC BY-SA 4.0 | same car | Alonso's #8 R24 head-on in his museum; no race photo of his car frames as well. | +| 2003 | Williams FW25, Juan Pablo Montoya, Monaco, head-on | Juan Pablo Montoya 2003 Silverstone 10.jpg | CC BY-SA 2.0 | same car | Montoya's FW25 head-on at speed, the curated view; 1156x937, upscaled 1.6x, still sharp enough at poster size. | +| 2002 | Ferrari F2002 #1, Michael Schumacher | Ferrari F2002 front.jpg | CC BY 2.0 | same car | The #1 F2002 head-on, a portrait photo that fits the poster whole. | +| 2001 | Minardi PS01 #21, Fernando Alonso (European livery) | Minardi PS01 front 2017 Museo Fernando Alonso.jpg | CC BY-SA 4.0 | same car | Alonso's own #21 PS01 head-on; the front view keeps the nose and livery in the crop, a three-quarter view cut into a wheel. | +| 2000 | Ferrari F1-2000 (Marlboro), Michael Schumacher or Rubens Barrichello, 2000 Brazilian GP (the reference's caption) | Ferrari F1-2000, Michael Schumacher (53277830647).jpg | CC BY 2.0 | same car | Schumacher's Ferrari F1-2000 #3 on display, from the front like the reference; nose with the 3, Shell and FedEx fill the crop. No free photo shows it racing | +| 1999 | McLaren MP4/14 Mercedes (West silver and black), probably Mika Häkkinen #1, 1999 Australian GP | McLaren MP4-14, Mika Häkkinen (The Loh Collection) 2.jpg | CC BY 4.0 | same car | Häkkinen's McLaren MP4/14 #1 in the Loh Collection, from the front like the reference, West on the rear wing; nose, the 1 and Mobil in the crop. No free photo shows it racing | +| 1998 | Ferrari F300 (Marlboro), probably Michael Schumacher, in action | 1998 F1 car Ferrari F300 Goodwood 2009.jpg | CC BY 2.0 | same car | a Ferrari F300 running at Goodwood in 2009, head-on in action; nose, Shell and the driver fill the crop. Schumacher's own F300 at the 1998 Spanish GP (12095605603) is a side view whose crop cuts the car | +| 1997 | Williams FW19 Renault (Rothmans), Jacques Villeneuve #3, in action | Williams FW19 of Jacques Villeneuve, 1997.jpg | CC BY-SA 2.0 | same car | Villeneuve's own Williams FW19 #3 in the Rothmans livery of the reference, head-on in a portrait photo: the whole car is in the crop | +| 1996 | Jordan 196 Peugeot (Benson & Hedges gold), Rubens Barrichello or Martin Brundle (helmet not readable), in action | Rubens Barrichello - Imola 1996.jpg | CC BY-SA 4.0 | same car | Barrichello's Jordan 196 at Imola in 1996, side view in action like the reference; the whole car with B&H in the crop, small in the frame | +| 1995 | Benetton B195 Renault (Mild Seven), Michael Schumacher #1, at Monaco | Benetton B195 front-left1 2019 Michael Schumacher Private Collection.jpg | CC BY-SA 4.0 | same car | Schumacher's Benetton B195 #1 in the Mild Seven livery of the reference, in his private collection; the race photos of 1995 (British GP, Bitburger livery) crop to half a car | +| 1994 | Williams FW16 Renault (Rothmans), Ayrton Senna #2, in action | Williams FW16 front 2017 Williams Conference Centre.jpg | CC BY-SA 4.0 | same car | the Williams FW16 #2 in its 1994 Rothmans livery at the Williams Conference Centre; no free photo shows Senna's car racing. Front view: Renault, elf and the 2 fill the crop | +| 1993 | Williams FW15C Renault (Camel, Canon, elf), Alain Prost #2, in action | Alain Prost - Williams FW15C during practice for the 1993 British Grand Prix (33557472711).jpg | CC BY-SA 2.0 | same car | Prost's own Williams FW15C #2 in practice for the 1993 British GP, from the front like the reference; nose with elf and the 2, Prost's helmet in the crop | +| 1992 | McLaren MP4/7A Honda (Marlboro), Ayrton Senna #1, leading Mansell's Williams FW14B #5 at Monaco | Ayrton Senna 1992 Monaco.jpg | CC BY 2.0 | same car | Senna's own McLaren MP4/7A in practice for the 1992 Monaco GP, the reference's race; his helmet and the red and white nose in the crop. Small original (1024x683), upscaled | +| 1991 | Jordan 191 Ford (7Up green and blue), #32 (Bertrand Gachot's number, which Michael Schumacher took at Spa), in action | Bertrand Gachot 1991 USA.jpg | CC BY 2.0 | same car | Gachot's own Jordan 191 #32 at the 1991 United States GP, side view in action like the reference; 7Up, Ireland and the cockpit in the crop. Small original (1229x819), upscaled | +| 1990 | McLaren MP4/5B Honda (Marlboro), Ayrton Senna #27, in action with Berger's car behind | McLaren MP4-5B front-right Honda Collection Hall.jpg | CC BY-SA 3.0 | same car | Senna's McLaren MP4/5B #27 at the Honda Collection Hall; no free photo shows it in action, this one keeps Marlboro, Honda and the 27 in the crop | +| 1989 | Lola LC89 Lamborghini (Larrousse; Camel, BP, Rhône-Poulenc, Espo), probably Philippe Alliot, in action | Musée Lamborghini 0078.JPG | CC BY-SA 3.0 | same car | a Larrousse Lola LC89 Lamborghini of 1989 in the Lamborghini museum, with the reference's Camel, BP, Rhône-Poulenc and Seine Maritime marks; its nose is green and red where the reference's is yellow (GEO/Espo). The only free LC89 photos besides two race starts where it is a speck | +| 1988 | McLaren MP4/4 Honda (Marlboro), Ayrton Senna #12, in action | Ayrton Senna in 1988.jpg | CC BY 2.0 | same car | Senna in his McLaren MP4/4 #12 in a 1988 race, posted by the Instituto Ayrton Senna; nose, 12 and helmet fill the crop. Small original (1219x789), upscaled | +| 1987 | Ferrari F1/87, Gerhard Berger #28, in action | Ferrari F187 (1987) (22031030520).jpg | CC BY-SA 2.0 | same car | Berger's Ferrari F1/87 #28 running at Suzuka in 2015, front three-quarter at a kerb like the reference; cockpit and the 28 nose in the crop | +| 1986 | Lotus 98T Renault (JPS black and gold), Ayrton Senna #12, in action at Spa | Lotus 98T Donington 2007.jpg | CC BY 2.0 | same car | the Lotus 98T #12 in Senna's 1986 JPS livery, running at Donington in 2007; side view in action like the reference. A 1986 race photo on Commons (Lotus 98T of Ayrton Senna, 1986.jpg) came via a 2009 Flickr upload of what looks like an agency shot, so it was not picked | +| 1985 | Williams FW10 Honda (Canon), Keke Rosberg #6, in action | 1985 European GP Rosberg.jpg | CC BY-SA 2.0 | same car | Rosberg's own Williams FW10 #6 at the 1985 European GP, a portrait photo: the whole car in action in the crop | +| 1984 | Lotus 95T (JPS black and gold), Nigel Mansell #12, in action | Lotus 95T Classic-Days 2022 DSC 0141.jpg | CC BY-SA 4.0 | same car | a Lotus 95T in Mansell's 1984 JPS livery (his name on the cockpit), a Commons quality image; the JPS nose and sidepod fill the crop. Mansell's car at the 1984 British GP (10241974846) sits behind the year in the crop | +| 1983 | Renault RE40 (yellow and white, Renault elf), Alain Prost #15, from the front | Renault RE40 (30428152663).jpg | CC BY-SA 2.0 | same car | Prost's Renault RE40 #15 on display, seen from the front like the reference: the nose with the Renault diamond, elf and the 15 fill the crop | +| 1982 | Renault RE30B (yellow and white, Renault elf), René Arnoux #16, in action | Rene Arnoux 1982 British GP.jpg | CC BY-SA 2.0 | same car | Arnoux's own Renault RE30B at the 1982 British GP, in action from the front-left like the reference; the car fills the crop | +| 1981 | McLaren MP4/1 (Marlboro), John Watson #7, 1981 British GP at Silverstone | McLaren MP4 at Silverstone Classic 2011 (1).jpg | CC BY 2.0 | same car | Watson's McLaren MP4/1 #7 (his name on the cockpit) running at Silverstone in 2011; a side view, so the crop keeps the cockpit and Marlboro sidepod, not the nose | +| 1980 | Ferrari 312T5, Gilles Villeneuve #2, in action (Monaco) | Ferrari 312T5 Gilles Villeneuve 2010 Canada 1.jpg | CC BY-SA 2.0 | same car | Villeneuve's Ferrari 312T5 #2 in its 1980 livery, run at Montreal in 2010; front three-quarter at a corner like the reference, nose and cockpit in the crop | +| 1979 | Wolf WR7 (Olympus Cameras black and gold), James Hunt #20, 1979 Argentine GP | FoS20162016 0624 103601AA (27851813796).jpg | CC BY-SA 2.0 | same car | the Wolf WR7 #20 in its 1979 Olympus livery, run at Goodwood 2016; front three-quarter as in the reference, whole car in the crop | +| 1978 | Arrows FA1 (Warsteiner gold and black), Riccardo Patrese #35, at Brands Hatch | Riccardo Patrese - Arrows FA1 at Druids at the 1978 British Grand Prix (50050521097).jpg | CC BY-SA 2.0 | same car | Patrese's own Arrows FA1 #35 at Druids, 1978 British GP, front three-quarter as in the reference; whole car in the crop | +| 1977 | ATS Penske PC4 (yellow ATS livery), Jean-Pierre Jarier #34 | Jean-Pierre Jarier - Penske PC4 at Tabac at the 1977 Monaco GP.jpg | CC BY-SA 2.0 | same car | Jarier's own yellow ATS Penske PC4 at the 1977 Monaco GP, the only free photo of that car; it sits small under a hoarding in the crop but is clearly the yellow ATS. Found by a search for the car by name: the file is not in the "1977 Formula One season cars" category | +| 1976 | McLaren M23 (Marlboro), James Hunt #11, in action; Lauda's Ferrari 312T2 #1 behind | James Hunt - McLaren M23 - 1976 Race of Champions, Brands Hatch.jpg | CC BY-SA 2.0 | same car | Hunt's own 1976 McLaren M23 #11 in action at the 1976 Race of Champions, front three-quarter like the reference; small original (1160x774), upscaled but the car is clear | +| 1975 | Shadow DN5, black UOP colours, number 16, Tom Pryce at the 1975 French Grand Prix (period colour photo) | Jean-Pierre Jarier Shadow DN5 2019 Silverstone Classic (48557920447).jpg | CC BY 2.0 | same car | The Shadow DN5 of Pryce's team-mate Jarier in the same 1975 UOP colours, at the Silverstone Classic 2019 (number 75 here); airbox, stripes and front wing fill the crop. Commons gives the author as the photographer's Flickr address. Found by a search for the car by name: the file is not in the "1975 Formula One season cars" category | +| 1974 | Tyrrell 007, blue Elf colours, number 3, Jody Scheckter (period colour photo) | Franschhoek Motor Museum (30524452055).jpg | CC BY 2.0 | same car | The Tyrrell 007 with number 3 in the Franschhoek Motor Museum (Scheckter's car, his name on its side in a sibling photo), nose-on; the Elf nose, number and Tyrrell Ford lettering fill the crop | +| 1973 | Ferrari 312B2, red and white, number 9, Jacky Ickx early in 1973 (period colour photo) | Ferrari 312B2 Jacky Ickx 2010 Canada.jpg | CC BY-SA 2.0 | same car | Jacky Ickx's Ferrari 312B2 in Scuderia Ferrari's red and white, at the historic race of the 2010 Canadian Grand Prix (number 4, his 1972 number); nose-on, the car fills the crop | +| 1972 | Lotus 72D, black and gold John Player Special, number 32, Emerson Fittipaldi (period colour photo) | 1972 Lotus 72D (54834288360).jpg | CC BY 4.0 | same car | Fittipaldi's 1972 championship Lotus 72D in the same JPS colours, at Silverstone 2025 (number 1 here); nose-on, the whole car in the portrait frame | +| 1971 | Lotus 72 in black and gold John Player Special colours, number 1, Ronnie Peterson at Monaco: a 1974 car (the 72E), not one of 1971 | 1971 Emerson Fittipaldi, Lotus 72 (kl).JPG | CC BY-SA 3.0 de | same model, other livery | The same model in the colours Team Lotus raced in 1971: Gold Leaf Team Lotus, Emerson Fittipaldi's 72D, number 8, in practice for the 1971 German Grand Prix (period colour). Only a 1217-pixel copy exists on Commons; soft on the poster but the livery, name and number read | +| 1970 | Lotus 72, Gold Leaf red and gold, number 10, Jochen Rindt at the 1970 Dutch Grand Prix (period colour photo) | Rindt at 1970 Dutch Grand Prix.jpg | CC BY-SA 3.0 nl | same car | Rindt's Lotus 72, number 10, at the same race, 21 June 1970 (black and white); the wedge nose, number and driver fill the crop | +| 1969 | Lotus 49B, Gold Leaf red, white and gold with its rear wing, airborne at the 1969 German Grand Prix (period colour photo) | Jochen Rindt 1969 German GP.jpg | CC BY-SA 2.0 de | same car | Rindt's Lotus 49B, number 2, in practice for the same race, 1 August 1969 (period colour); livery, wing and driver in the crop | +| 1968 | Matra MS10 of Matra International, blue, number 6, Jackie Stewart winning the wet 1968 German Grand Prix (period colour photo) | Stewart, J., Matra MS10, 2. Rd 1968-08-04 v2.jpg | CC BY-SA 2.0 de | same car | Stewart's MS10, number 6, on lap 2 of the same race, 4 August 1968 (period colour, grainy); the number, Elf decal, cockpit and wing read in the crop | +| 1967 | Cooper-Maserati T81 of the Cooper works team, dark green with white stripes, number 3, at the 1967 South African Grand Prix (period colour photo) | 1967 Cooper-Maserati T86 191599250.jpg | CC BY 2.0 | same team and season | The works Cooper-Maserati T86 Jochen Rindt drove in 1967, in the works green with a white stripe, at Goodwood 2006; engine, driver and number in the crop. The only works T81 photo (Rodriguez, Zandvoort 1967 practice, CC0) shows just the windscreen and driver; the blue T81 at Bologna 2016 is not named as Guy Ligier's 1967 entry on Commons or Wikipedia (Ligier raced a T81 at two 1967 rounds) | +| 1966 | Brabham-Repco BT19, green with a gold nose, number 3, Jack Brabham (period colour photo) | Brabham BT19, NSM, 2008 vertical.JPG | CC BY-SA 3.0 | same car | The Brabham BT19 (one chassis was built: Brabham's 1966 championship car) at the National Sports Museum, Melbourne; a portrait photo, nose-on, the whole car in frame | +| 1965 | Honda RA272, white with the red disc, number 12, in a demonstration run | Honda RA272 (Hikaru Miyagi).jpg | CC BY 2.0 | same car | The RA272 in its 1965 Mexican Grand Prix number 12, demonstrated at the 2012 Japanese Grand Prix; small in the frame but whole. (A larger whole-car portrait of number 11, "1965 Honda RA272 2.jpg", is the alternative) | +| 1964 | Ferrari 158, red with pale blue wheels, on track at Goodwood | John Surtees Ferrari 158 at Goodwood 2014 001.jpg | CC BY-SA 2.0 | same car | John Surtees driving his championship-winning 1964 Ferrari 158 at Goodwood 2014; one of the season's candidates; driver, number 2 and blue wheel in the crop | +| 1963 | Lotus 25, green with a yellow stripe and yellow wheels, number 4, Jim Clark at the 1963 British Grand Prix (period colour photo) | 1963 Lotus 25 R4 (54833107267).jpg | CC BY 4.0 | same car | Chassis R4, Clark's 1963 championship Lotus 25, at Silverstone 2025 (number 25 here); nose-on, the whole car in the portrait frame | +| 1962 | Porsche 804, silver, on the hill at the Goodwood Festival of Speed | Porsche 804 Solitude Revival 2022 1X7A0078.jpg | CC BY-SA 4.0 | same car | The Porsche 804 on the move at the Solitude Revival 2022, from the same front three-quarter angle; one of the season's candidates | +| 1961 | Ferrari 156 "sharknose", red, von Trips at the 1961 Dutch Grand Prix (period colour photo) | Von Trips and P. Hill at 1961 Dutch Grand Prix.jpg | CC BY-SA 3.0 nl | same car | Von Trips's Ferrari 156 at the same race, 22 May 1961, Phil Hill's behind (black and white); the sharknose nose and driver fill the crop | +| 1960 | Scarab F1 (Reventlow Automobiles), metallic blue, number 48 | Millers at Milwaukee 2026 061 (1960 Scarab Formula 1 No. 48).jpg | CC BY-SA 4.0 | same car | The 1960 Scarab Formula 1 car number 48 itself, at Milwaukee 2026; a portrait photo, nose-on, the whole car in frame | +| 1959 | Cooper T51 of Rob Walker Racing, dark blue with a white band, number 14, Stirling Moss on the 1959 Italian Grand Prix grid (beside Ferrari Dino 246s) | Autoraces op het circuit van Zandvoort van de Grand Prix Stirling Moss (no.11) t, Bestanddeelnr 910-4129.jpg | CC0 | same car | Moss's own Walker Cooper T51 at the 1959 Dutch Grand Prix (number 11, period black and white); the car comes head-on into the crop. A colour photo of an ex-Walker T51 lost its nose in the crop | +| 1958 | Ferrari 246 F1 (Dino), red, number 2, Mike Hawthorn at the 1958 British Grand Prix (period colour photo) | 1958 Ferrari Dino 246 (54834214458).jpg | CC BY 4.0 | same car | The Ferrari Dino 246 shown as Hawthorn's 1958 championship car at Silverstone 2025 (number 38 here); the car fills the portrait frame | +| 1957 | Maserati 250F, red, number 32, Fangio at the 1957 Monaco Grand Prix | 1957 Maserati 250F (54834214403).jpg | CC BY 4.0 | same car | A red 1957 Maserati 250F with number 32, shown as Fangio's championship-winning car at Silverstone 2025; the whole car fits the portrait frame. Found by a search for the car by name: the file is not in the "1957 Formula One season cars" category | +| 1956 | Lancia-Ferrari D50 of Scuderia Ferrari, red, number 10, Fangio at the 1956 French Grand Prix (period colour photo) | Lancia D50 of Scuderia Ferrari.jpg | CC BY 2.0 | same car | A Lancia D50 in Scuderia Ferrari's form (Commons: Lancia D50 of Scuderia Ferrari), side view: the Ferrari badge, the side pontoon with number 17 and the engine fill the crop. A sharper D50A at Goodwood 2024 wears a green nose band no source dates to 1956, so it was dropped | +| 1955 | Mercedes-Benz W196 (open wheels), silver, a colour photo of a demonstration run | Goodwood Festival of Speed 2015 (26733252225).jpg | CC BY-SA 2.0 | same car | The open-wheel W196 at speed, Stirling Moss driving at Goodwood 2015; its nose, star and driver fill the crop | +| 1954 | Mercedes-Benz W196 (open wheels), silver, number 18, Fangio at the 1954 German Grand Prix (period photo) | Großer Preis von Europa -1954 Nürburgring, Juan Manuel Fangio, Mercedes (3)x.JPG | CC BY-SA 3.0 | same car | Fangio's W196 number 18 at the same race, 1 August 1954, black and white like the curated one; car and driver in the crop's lower half | +| 1953 | Ferrari 500, red, a Swiss entrant's script on the nose, on track at a historic run | Goodwood Festival of Speed 2024 (54254822116).jpg | CC BY 2.0 | same car | A 1952 Ferrari 500 F2 (chassis 0482) on the move at Goodwood 2024, seen from the same front three-quarter angle; nose, wheel and cockpit stay in the crop | +| 1952 | Ferrari 375 Indianapolis "Ferrari Special", red, number 35: Johnny Mauro's Kennedy Tank entry, which failed to qualify for the 1952 Indianapolis 500 | Grote Prijs Nederlandse autoraces Zandvoort. Finish Askari, Bestanddeelnr 905-2692.jpg | CC0 | champion | Alberto Ascari's Ferrari 500, number 2, at the finish of the 1952 Dutch Grand Prix (black and white). The one Commons photo of the red Ferrari Special (Indianapolis Motor Speedway Museum) shows only its lettering in the crop; every other 375 Indy on Commons wears the cream Grant Piston Ring livery, which Wikipedia says Johnnie Parsons meant to race in 1952 but did not, so it is no confirmed 1952 entry; no other Kennedy Tank car exists | +| 1951 | Ferrari 212 F1, red with a white nose band, number 15, on track at a historic meeting | Ferrari 212 F1.jpg | CC BY 2.0 | same car | A 1951 Ferrari 212 F1 in the same red and white livery; the crop keeps its 212 badge, the Ferrari shield and the front wheel | +| 1950 | Ferrari 375 F1, red, on track at Silverstone (a 2011 demonstration) | Galleria Ferrari (9) (3955971032).jpg | CC BY-SA 2.0 | same car | Ascari's Ferrari 375 F1 in the Ferrari museum, seen from above: the whole car fits the portrait crop (Leclerc's 2021 Silverstone run of the same car showed only its middle) | diff --git a/tests/test_posters.py b/tests/test_posters.py index 850376d..c09848d 100644 --- a/tests/test_posters.py +++ b/tests/test_posters.py @@ -80,6 +80,10 @@ class CreditAndLicenceTest(unittest.TestCase): self.assertEqual(ps.picture_licence(shares), licence, shares) with self.assertRaises(ps.LicenceClash): ps.picture_licence([by_sa, ps.eox(2025).share]) + # 2.5 and the ported licences allow a later version with the same elements, as 2.0 and 3.0 do + for licence in ("CC BY-SA 2.5", "CC BY-SA 2.0 de", "CC BY-SA 3.0 de", "CC BY-SA 3.0 nl"): + self.assertTrue(ps.is_free_licence(licence), licence) + self.assertEqual(ps.picture_licence([ps.pick_share({"licence": licence})]), "CC BY-SA 4.0", licence) def test_picks_skip_notes_and_refuse_what_they_cannot_use(self): with tempfile.TemporaryDirectory() as kept: @@ -102,6 +106,28 @@ class CreditAndLicenceTest(unittest.TestCase): self.assertEqual(len(logged.output), 4) for name in ("circuits/photos.json", "seasons/photos.json"): self.assertEqual(ps.read_picks(ROOT / name).get("$comment"), None, name) + # Every season from 1950 to 2026 has its picked photo, keyed in year order, and the reader accepts each one + written = json.loads((ROOT / "seasons/photos.json").read_text(encoding="utf-8")) + seasons = [str(year) for year in range(1950, 2027)] + self.assertEqual([key for key in written if not key.startswith("$")], seasons) + self.assertEqual(list(ps.read_picks(ROOT / "seasons/photos.json")), seasons) + for year in seasons: # where the date was read when Commons' own date cannot be when the photo was taken + self.assertIn(written[year].get("date_from", "description"), ("description", "category", "upload"), year) + + def test_the_table_of_picks_names_the_match_per_season(self): + """seasons/picks.md: one row per picked season, newest first, its file and licence those of + seasons/photos.json, its match one of the design's four (docs/posters.md, Season posters).""" + matches = ("same car", "same model, other livery", "same team and season", "champion") + picks = ps.read_picks(ROOT / "seasons/photos.json") + rows = [] + for line in (ROOT / "seasons/picks.md").read_text(encoding="utf-8").splitlines(): + if line.startswith("| ") and line[2:6].isdigit(): + rows.append([cell.strip() for cell in line.strip().strip("|").split(" | ")]) + self.assertEqual([row[0] for row in rows], sorted(picks, key=int, reverse=True)) + for year, curated, file, licence, match, why in rows: + self.assertEqual((file, licence), (picks[year]["file"], picks[year]["licence"]), year) + self.assertIn(match, matches, year) + self.assertTrue(curated and why, year) def test_the_picks_routes_answer_the_picks_as_the_service_has_them_loaded(self): photo = {"file": "A.jpg", "licence": "CC BY 4.0", "author": "A", "credit": "Photo: A", "date": "2020"} -- 2.54.0 From 25fee9ca85273a70da6c72cb9380e040a878d259 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 30 Nov 2026 10:51:49 +0100 Subject: [PATCH 3/4] Give the addresses an address version of their own, raised to a1 Every season poster changed with the joined picks, but the Kometa file kept handing out ?v=r3, an address clients keep for good: they would never load the new season posters. Raising the render version instead would draw every kept layer and finished picture again, though only the season posters changed. poster_options.ADDRESS_VERSION ("a1") sits beside RENDER_VERSION: the Kometa file writes it into every poster address, and only an address carrying it is sent the immutable Cache-Control; an address with ?v=r3 is now any other address (a day, then its ETag). Layers and finished pictures stay keyed by RENDER_VERSION, still r3, so nothing kept is drawn again except the season posters whose photo changed. The API's option text, the Kometa docstring and the README say "address version". The options test: ?v=a1 is kept for good, ?v=r3 no longer (on master it fails: no ADDRESS_VERSION, and ?v=r3 is still the immutable address). Builds: docs/posters.md at f6b9f937d09a3b79b2312af5bfd290c7408b20fb (Finished images: what clients keep, the address version) Claude-Session: https://claude.ai/code/session_01JG73KFhbaNj3tyJ8tKmE3W --- README.md | 2 +- cdn-api.py | 6 +++--- poster_options.py | 11 +++++++---- posters_service.py | 6 +++--- tests/test_posters.py | 5 ++++- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index ea5118a..5023c42 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ layers, at most 2 GB, the least recently used going first; a second season of a and fetches nothing. A picture whose map or photo did not arrive is served without it, kept nowhere, and sent with five minutes' `Cache-Control` and no `ETag`. -Clients keep an address that carries the render version (`?v=r3`, as the Kometa file writes it) for good +Clients keep an address that carries the address version (`?v=a1`, as the Kometa file writes it) for good (`immutable`); any other address a day, then ask again with its `ETag` and get a 304 while it is unchanged. Every request the service makes carries the User-Agent `f1-circuits/ (+)`. OpenStreetMap tiles are fetched only when a picture asks for them, at most two at once; Wikimedia Commons is asked one request at a time. diff --git a/cdn-api.py b/cdn-api.py index e9dd22e..3ea1e60 100644 --- a/cdn-api.py +++ b/cdn-api.py @@ -148,14 +148,14 @@ POSTER_OPTIONS_DOC = """Options are query parameters, the same on every poster r dark, light, none), `photo` (natural, bw), `show` (a comma list of wordmark, round, name, subtitle, date, circuit, locality, session), `locator` and `checker` (on, off), `track` (off, or #rrggbb with an optional width: #ffffff,6), `dim` (0 to 1), `accent` (#rrggbb), `width` (400 up to the frame's), `format` (png, jpg, webp), and - `v`, the render version, which the Kometa file adds so clients keep the picture for good.""" + `v`, the address version, which the Kometa file adds so clients keep the picture for good.""" def render_poster(request: Request, kind: str, grand_prix_name: Optional[str] = None, season: Optional[int] = None, session_slug: Optional[str] = None) -> Response: """A picture with its credits, its licence and what clients may keep of it. - An address with the current render version (?v=) is kept for good; any other a day, then asked again with its + An address with the current address version (?v=) is kept for good; any other a day, then asked again with its ETag (a 304 while it is unchanged); a picture served without its map or photo five minutes, with no ETag.""" try: options = poster_options.parse_options(request.query_params.multi_items(), kind) @@ -213,7 +213,7 @@ def get_kometa_metadata(): - uses Kometa's f1_season builder for round/episode names - sets url_poster on the show (the season poster) - sets url_poster on each Plex 'season' (== each F1 round) from the race poster route, and on each episode - from the session thumbnail route; every address carries ?v= + from the session thumbnail route; every address carries ?v=
Kometa harmlessly skips shows / seasons that don't exist in the Plex library, so we can emit the full schedule and let Kometa do the matching. diff --git a/poster_options.py b/poster_options.py index b1c5594..4cf11be 100644 --- a/poster_options.py +++ b/poster_options.py @@ -8,9 +8,12 @@ import re from dataclasses import dataclass from typing import Iterable, Optional -# Part of every layer's and every finished picture's key: raised when what a picture looks like changes, so no +# Part of every layer's and every finished picture's key: raised only when the drawing itself changes, so no # picture made before is served again. r3: licensed sources, kept layers, options and credits. RENDER_VERSION = "r3" +# Carried by the address clients are given (?v=), separate from RENDER_VERSION: raised when a look changes, so clients +# load the address again, served from the pictures already kept. a1: every season poster changed (the season photos). +ADDRESS_VERSION = "a1" # A frame is the picture's own size: a poster (race and season) and a session thumbnail. FRAMES = {"poster": (1000, 1500), "thumb": (1920, 1080)} @@ -69,7 +72,7 @@ class Options: accent: str width: int format: str - versioned: bool # the address carries the current render version (?v=) + versioned: bool # the address carries the current address version (?v=) def canonical(self) -> str: """The options as they are drawn, the style resolved: two addresses that draw the same picture match.""" @@ -157,7 +160,7 @@ def parse_options(items: Iterable[tuple[str, str]], kind: str) -> Options: fmt = _choice("format", given.get("format", "png"), tuple(FORMATS)) return Options(style=style, bg=bg, photo=photo, show=show, locator=locator, checker=checker, track=track, - dim=dim, accent=accent, width=width, format=fmt, versioned=given.get("v") == RENDER_VERSION) + dim=dim, accent=accent, width=width, format=fmt, versioned=given.get("v") == ADDRESS_VERSION) # ------------------------------------------------------------------ keys @@ -194,7 +197,7 @@ def finished_key(route: str, options: Options, layer_keys: Iterable[str]) -> str # ------------------------------------------------------------------ what clients keep def cache_headers(kept: bool, versioned: bool, etag: str) -> dict[str, str]: - """An address with the current render version is kept for good; any other a day, asked again with its ETag; + """An address with the current address version is kept for good; any other a day, asked again with its ETag; a picture served without its layer five minutes, with no ETag.""" if not kept: return {"Cache-Control": "public, max-age=300"} diff --git a/posters_service.py b/posters_service.py index cca7c73..a7859b6 100644 --- a/posters_service.py +++ b/posters_service.py @@ -919,12 +919,12 @@ class PostersService: def render_kometa_metadata(self, first_season: int = 1950, last_offset: int = 1) -> str: """The Kometa metadata YAML for the Formula 1 library, every season from `first_season` through current_year + last_offset. Per show: the f1_season builder and the season poster; per Plex season (a - round): its race poster; per episode: its session thumbnail. Every poster address carries the render - version, so clients keep it for good and a changed look reaches them under a new address.""" + round): its race poster; per episode: its session thumbnail. Every poster address carries the address + version (?v=), so clients keep it for good and a changed look reaches them under a new address.""" from datetime import datetime from urllib.parse import quote - version = f"?v={po.RENDER_VERSION}" + version = f"?v={po.ADDRESS_VERSION}" last_season = datetime.utcnow().year + last_offset lines: list[str] = [ "# This file's data (race names, rounds, dates) comes from the Jolpica F1 API " diff --git a/tests/test_posters.py b/tests/test_posters.py index c09848d..38ac28e 100644 --- a/tests/test_posters.py +++ b/tests/test_posters.py @@ -183,7 +183,10 @@ class OptionsTest(unittest.TestCase): # Any option given overrides the style; equal pictures share one canonical form, whatever their address self.assertEqual(self.parse("style=minimal&checker=on").checker, True) self.assertEqual(self.parse("bg=aerial&v=r1").canonical(), self.parse("").canonical()) - self.assertTrue(self.parse(f"v={po.RENDER_VERSION}").versioned) + # Kept for good: an address with the address version, never one with the render version it carried before + self.assertTrue(self.parse(f"v={po.ADDRESS_VERSION}").versioned) + self.assertNotEqual(po.ADDRESS_VERSION, po.RENDER_VERSION) + self.assertFalse(self.parse("v=r3").versioned) self.assertFalse(self.parse("v=r2").versioned) def test_an_unknown_option_or_value_is_named(self): -- 2.54.0 From e5874f2d9fb008f67f09789a8b3871f12c87beab Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 30 Nov 2026 11:33:17 +0100 Subject: [PATCH 4/4] Key a finished picture by the credit it draws A finished picture's key named its route, its options and its layers' keys, but not the credit it draws from a pick. A pick whose author or licence changed while its file stayed the same kept its photo layer's key, so the stored picture was served again with the old credit drawn on it, while X-Credits already said the new one (seen locally for 1967, whose author lost Commons' "upload by" appendix). finished_key now also takes every text the picture draws from a pick: the credit of each layer made from a pick's photo (Layer.from_pick, season and layout picks alike). A map's credit follows its source, which its layer key already names. A picture drawn from no pick adds nothing to the digest, so its key is the one it had: no kept race, session or pick-less season picture is drawn again. Seen locally with the old store in place: the race poster, the session thumbnail and the season poster with bg=none came from the store under their old keys; the 1967 and 1989 season posters were drawn once under new keys. No release of master ever held a photo pick (neither seasons/photos.json nor circuits/photos.json), so the running service keeps no picture whose key changes. The keys test: the same photo with another credit makes another key (on the old code finished_key takes no credit; with the credit ignored the keys are equal), and a picture drawn from no pick keeps the digest of render version, route, options and layer keys it had. Builds: docs/posters.md at f6b9f937d09a3b79b2312af5bfd290c7408b20fb (Finished images: the key names the credit of each layer drawn from a pick; Principles, 2: a changed input makes a new key) Claude-Session: https://claude.ai/code/session_01JG73KFhbaNj3tyJ8tKmE3W --- poster_options.py | 10 +++++++--- posters_service.py | 11 +++++++---- tests/test_posters.py | 9 +++++++++ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/poster_options.py b/poster_options.py index 4cf11be..c7c487e 100644 --- a/poster_options.py +++ b/poster_options.py @@ -187,10 +187,14 @@ def outline_layer_key(trace: str, frame: str, zoom: int) -> str: return f"outline/{trace}-{frame}-z{zoom}" -def finished_key(route: str, options: Options, layer_keys: Iterable[str]) -> str: - """A finished picture's name in the store: its route, its options and the keys of the layers it was made from.""" +def finished_key(route: str, options: Options, layer_keys: Iterable[str], picked: Iterable[str] = ()) -> str: + """A finished picture's name in the store: its route, its options, the keys of the layers it was made from, and + every text it draws from a pick (a photo's credit), so a changed credit makes a new key (docs/posters.md, + principle 2). A picture drawn from no pick keeps the key it had before: nothing is added for it.""" made_of = "|".join(sorted(layer_keys)) - digest = hashlib.sha256(f"{RENDER_VERSION}\n{route}\n{options.canonical()}\n{made_of}".encode()).hexdigest() + texts = "\n".join(text for text in picked if text) + drawn = f"\n{texts}" if texts else "" + digest = hashlib.sha256(f"{RENDER_VERSION}\n{route}\n{options.canonical()}\n{made_of}{drawn}".encode()).hexdigest() return f"{digest[:40]}.{options.format}" diff --git a/posters_service.py b/posters_service.py index a7859b6..59bf4b6 100644 --- a/posters_service.py +++ b/posters_service.py @@ -421,11 +421,13 @@ class Rendered: @dataclass class Layer: """One layer a picture is made from: its key, its credit, what its source asks of the picture (share-alike or - not), and how to get it (from the store, or made now).""" + not), how to get it (from the store, or made now), and whether it is a pick's photo, whose credit the finished + picture's key names (a map's credit follows its source, which its key already names).""" key: str credit: str share: Optional[str] get: Callable[[], Optional[Image.Image]] + from_pick: bool = False class PostersService: @@ -534,7 +536,7 @@ class PostersService: credit, share = ps.pick_credit(pick), ps.pick_share(pick) info = self.commons.info(pick["file"]) if info is None: # no key without its SHA-1: served without the photo, and asked again next time - return Layer(f"photo/{pick['file']}?", credit, share, lambda: None) + return Layer(f"photo/{pick['file']}?", credit, share, lambda: None, from_pick=True) key = po.photo_layer_key(pick["file"], info["sha1"], frame) def make(): @@ -547,7 +549,7 @@ class PostersService: logger.warning(f"Commons file {pick['file']!r} unreadable: {e}") return None return cover(img, po.FRAMES[frame]) # kept untreated: the treatment is drawn on assembly - return Layer(key, credit, share, lambda: self._kept_or_made(key, "jpg", make)) + return Layer(key, credit, share, lambda: self._kept_or_made(key, "jpg", make), from_pick=True) def _locator_layer(self, geo: Geo) -> Layer: lat, lon = round(geo.lat, 2), round(geo.lon, 2) @@ -714,7 +716,8 @@ class PostersService: A stored picture was made from every layer it names, so its credit line and its licence are theirs.""" layers = [layer for layer in (background, locator) if layer] ps.picture_licence([layer.share for layer in layers]) # a clash of share-alike terms is refused, not drawn - name = po.finished_key(route, options, [layer.key for layer in layers] + ([outline] if outline else [])) + name = po.finished_key(route, options, [layer.key for layer in layers] + ([outline] if outline else []), + [layer.credit for layer in layers if layer.from_pick]) media_type = po.FORMATS[options.format] stored = self.store.get(name) if stored is not None: diff --git a/tests/test_posters.py b/tests/test_posters.py index 38ac28e..202fc07 100644 --- a/tests/test_posters.py +++ b/tests/test_posters.py @@ -2,6 +2,7 @@ Standard library only (no PIL, no numpy), so the merge check runs it as it is. """ +import hashlib import json import os import tempfile @@ -211,6 +212,14 @@ class OptionsTest(unittest.TestCase): ["map/eox-2016/x-poster-z15-r3"])) self.assertTrue(key.endswith(".png")) self.assertTrue(po.finished_key("race/Bahrain Grand Prix/2024", self.parse("format=webp"), []).endswith(".webp")) + # A changed credit with the same photo makes a new key; a picture drawn from no pick keeps the key it had + season, photo = self.parse("", "season"), ["photo/a1b2c3-sha1-poster-r3"] + credited = po.finished_key("season/1967", season, photo, ["Photo: A, CC BY 2.0, via Wikimedia Commons"]) + self.assertNotEqual(credited, po.finished_key("season/1967", season, photo, + ["Photo: B, CC BY 2.0, via Wikimedia Commons"])) + before = hashlib.sha256(f"{po.RENDER_VERSION}\nrace/Bahrain Grand Prix/2024\n{options.canonical()}\n" + "map/eox-2016/x-poster-z15-r3".encode()).hexdigest() + self.assertEqual(key, f"{before[:40]}.png") self.assertEqual(po.locator_layer_key(26.0325, 50.5106), f"locator/26.03_50.51-{po.RENDER_VERSION}") self.assertIn(po.RENDER_VERSION, po.map_layer_key("eox-2025", po.trace_hash([[1, 2]]), "thumb", 15)) -- 2.54.0