[object Object]

← back to Japan Enrich

lilycolor: fill 224 Henry-only image gaps on prod (make_lily_fill.py) -> 100% CDN-independent

79ba0fa38f6e4900b27a8f19346394b7ed6ee200 · 2026-07-01 14:43:42 -0700 · Steve Abrams

Files touched

Diff

commit 79ba0fa38f6e4900b27a8f19346394b7ed6ee200
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jul 1 14:43:42 2026 -0700

    lilycolor: fill 224 Henry-only image gaps on prod (make_lily_fill.py) -> 100% CDN-independent
---
 make_lily_fill.py          | 47 ++++++++++++++++++++++++++++++++++++++++++++++
 out/officer-yolo-ledger.md |  7 +++++++
 2 files changed, 54 insertions(+)

diff --git a/make_lily_fill.py b/make_lily_fill.py
new file mode 100644
index 0000000..758d3d7
--- /dev/null
+++ b/make_lily_fill.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python3
+"""
+Close the Lilycolor prod image gap. Most Lilycolor cards are served locally from
+images/all_c/ (extracted by fetch_c_zips.sh). ~224 SKUs, however, only have an
+image on the Mac2-mounted Henry volume (/Volumes/Henry/dw-lily-images/<sku>.jpg) —
+prod has no Henry mount, so those cards render blank.
+
+This downscales each Henry-only gap image to a 256px swatch named <sku>_H.jpg and
+drops it in images/lily-fill/. Rsync that into prod images/all_c/ and the viewer's
+allcIndex (keyed by normSku(filename.split('_')[0])) resolves it as /img/lily/<sku>,
+taking Lilycolor to 100% local coverage. $0 local (Pillow). Requires Henry mounted.
+"""
+import os, json, re
+from PIL import Image
+
+ALLC = "images/all_c"
+HENRY = "/Volumes/Henry/dw-lily-images"
+OUT = "images/lily-fill"
+STAGING = "staging/lilycolor-unified-staging.jsonl"
+os.makedirs(OUT, exist_ok=True)
+
+def norm(s): return re.sub(r"[^A-Za-z0-9]", "", (s or "")).upper()
+
+def main():
+    allc_keys = {norm(fn.split("_")[0]) for fn in os.listdir(ALLC)
+                 if re.search(r"\.(jpe?g|png)$", fn, re.I)}
+    rows = [json.loads(l) for l in open(STAGING) if l.strip()]
+    made = miss = skip = 0
+    for r in rows:
+        sku = r.get("mfr_sku")
+        if norm(sku) in allc_keys:
+            skip += 1; continue                      # already served via all_c
+        src = os.path.join(HENRY, f"{sku}.jpg")
+        if not os.path.exists(src): miss += 1; continue
+        dst = os.path.join(OUT, f"{sku}_H.jpg")       # split('_')[0]=sku -> allcIndex key
+        if os.path.exists(dst) and os.path.getsize(dst) > 0: made += 1; continue
+        try:
+            with Image.open(src) as im:
+                im = im.convert("RGB"); im.thumbnail((256, 256))
+                im.save(dst, "JPEG", quality=82, optimize=True)
+            made += 1
+        except Exception:
+            miss += 1
+    print(f"lily-fill: {made} gap-swatches -> {OUT} ({skip} already via all_c, {miss} missing/failed)")
+
+if __name__ == "__main__":
+    main()
diff --git a/out/officer-yolo-ledger.md b/out/officer-yolo-ledger.md
index 59880c8..f13297b 100644
--- a/out/officer-yolo-ledger.md
+++ b/out/officer-yolo-ledger.md
@@ -65,3 +65,10 @@
 - **Result:** rsync 14,097 swatches/159M + server.js → japan-viewer; node -c OK; pm2 reload; /img/sangetsu/<sku> → HTTP 200; 499/500 japan. Sangetsu cards now local. Full-res originals kept for re-enrichment (gitignored). Cost $0.
 - **Lilycolor:** NOT shipped — no local swatches exist (image_bytes_fetched 100% false); would need a fetch+downscale step first. Still on remote preview_images.
 - **Net:** china. (Greenland) + japan. (Sangetsu) both CDN-independent. Lilycolor imagery remains vendor-hosted.
+
+### Post-loop — SHIPPED Lilycolor (Steve-authorized "ship all", 2026-07-01)
+- **Correction:** earlier "Lilycolor has no local swatches" was WRONG — it read the `image_bytes_fetched` flag, but Lilycolor images come from the `all_c` zip extraction (fetch_c_zips.sh → images/all_c/), already 91% on prod (2,319/2,543).
+- **Gap found:** 224 SKUs were Henry-volume-only (Mac2 /Volumes/Henry/dw-lily-images) — prod has no Henry mount, so they rendered blank.
+- **Action:** make_lily_fill.py downscaled the 224 Henry-only images → 256px `<sku>_H.jpg` (3.0M) and shipped them into prod images/all_c/ (viewer allcIndex resolves them as /img/lily/). pm2 reload.
+- **Result:** /img/lily/<sku> → HTTP 200 for the gap SKUs; **Lilycolor local coverage 2,543/2,543 (100%)**. Cost $0.
+- **NET (ship all complete):** china. Greenland + japan. Sangetsu + japan. Lilycolor all 100%/near-100% CDN-independent on Kamatera. No vendor CDN dependency remains.

← d6bab41 ledger: shipped japan. Sangetsu swatches (14,097/159M, CDN-i  ·  back to Japan Enrich  ·  lilycolor: fix 4 rows with truncated width '00cm' -> '100cm' a4e6220 →