From c0d9592149837196be5e9e7bb29e073403b2e1eb Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Tue, 29 Sep 2026 21:29:44 +0000 Subject: [PATCH] make-previews wrote every WebP one directory too high MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit REPO was os.path.join(HERE, '..', '..'), and HERE is /library/scripts/posters -- so REPO resolved to /library, not the repo root. Both outputs went to directories nothing reads and nothing serves: library/plugin-designs//assets/previews/ instead of plugin-designs/... library/data/posters/ instead of data/posters/ ★ IT REPORTED SUCCESS WHILE DOING NOTHING USEFUL, which is what makes it worth a commit of its own. The script printed "[make-previews] N posters" and its two destination lines, wrote genuine WebPs, and exited 0. Only the files were in a tree no build stages, so the SERVED previews never changed. MEASURED, on one poster, before and after: before the regenerated thumbnail was byte-identical to the shipped one (same sha256, git status clean) -- 0 pixels changed after sha differs, git sees both files modified, and 52.9% of the thumbnail's pixels differ (21.1% by more than 40/255, max delta 255) Found by DRY-RUNNING this step on a single already-shot poster instead of discovering it after a 174-sheet reshoot. Without the fix that reshoot would have produced 174 correct WebPs in the wrong tree, the walls would have kept their old teal thumbnails, and the landing would have looked complete: a teal thumbnail over a hued print, which is the exact defect the reshoot exists to remove. The three-level form is what the other scripts in this folder already use to reach the root; this one was the odd one out. --- library/scripts/posters/make-previews.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/library/scripts/posters/make-previews.py b/library/scripts/posters/make-previews.py index a59316412..2449538a2 100644 --- a/library/scripts/posters/make-previews.py +++ b/library/scripts/posters/make-previews.py @@ -26,7 +26,13 @@ from PIL import Image HERE = os.path.dirname(os.path.abspath(__file__)) SRC = os.path.join(HERE, 'out', 'posters') -REPO = os.path.abspath(os.path.join(HERE, '..', '..')) +# ★ THREE LEVELS, NOT TWO. HERE is /library/scripts/posters, so '..','..' lands on +# /library and every output went to library/plugin-designs/... and library/data/posters -- +# directories nothing reads and nothing serves. The script REPORTED success and wrote real WebPs, +# so a preview run looked like it had worked while the served previews never changed. Found by +# dry-running this step on a single poster before a 174-sheet reshoot; it would otherwise have +# silently produced 174 files in the wrong tree and shipped the old thumbnails. +REPO = os.path.abspath(os.path.join(HERE, '..', '..', '..')) # WHICH APP the previews belong to. The country-posters app renders from the SAME # generator into the SAME out/posters, so the only thing that differs is where the # WebPs land — parameterize rather than fork this script.