[object Object]

← back to Dw Vendor Microsites

image-health: exclude base64 data: URIs from coverage (placeholder count + PLACEHOLDER status)

5317ea3921b5d3a3852682202cc7906c8ab7a389 · 2026-07-12 23:04:55 -0700 · Steve

rwltd captured lazy-load spinner SVGs as image_url, inflating coverage to ~1.0
and hiding that only 189/1071 rows have real images. Now reported honestly as
coverage 0.176 with placeholder=881. Real dead-link vendors (stout etc.) unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 5317ea3921b5d3a3852682202cc7906c8ab7a389
Author: Steve <steve@designerwallcoverings.com>
Date:   Sun Jul 12 23:04:55 2026 -0700

    image-health: exclude base64 data: URIs from coverage (placeholder count + PLACEHOLDER status)
    
    rwltd captured lazy-load spinner SVGs as image_url, inflating coverage to ~1.0
    and hiding that only 189/1071 rows have real images. Now reported honestly as
    coverage 0.176 with placeholder=881. Real dead-link vendors (stout etc.) unchanged.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 lib/image-health.sh | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/lib/image-health.sh b/lib/image-health.sh
index cd007ff..b6f5046 100755
--- a/lib/image-health.sh
+++ b/lib/image-health.sh
@@ -28,12 +28,18 @@ with open(src) as f:
         except: pass
 
 total = len(rows)
-with_img = [r for r in rows if (r.get('image_url') or '').strip()]
-missing = total - len(with_img)
+def _real_url(u):
+    u = (u or '').strip()
+    return bool(u) and not u.lower().startswith('data:')
+# base64 data: URIs are lazy-load placeholder SVGs (e.g. rwltd) — NOT real coverage
+with_img = [r for r in rows if _real_url(r.get('image_url'))]
+placeholder = sum(1 for r in rows if (r.get('image_url') or '').strip().lower().startswith('data:'))
+missing = total - len(with_img) - placeholder
 
 if not with_img:
-    print(json.dumps({"sampled":0,"live":0,"dead":0,"missing":missing,
-                      "total":total,"image_health":0.0,"relinked":0,"status":"EMPTY"}))
+    print(json.dumps({"sampled":0,"live":0,"dead":0,"missing":missing,"placeholder":placeholder,
+                      "total":total,"image_health":0.0,"relinked":0,
+                      "status":"PLACEHOLDER" if placeholder else "EMPTY"}))
     sys.exit(0)
 
 # sample for the HEAD probe (cheap, representative)
@@ -77,7 +83,7 @@ status = "HEALTHY" if health >= 0.5 else "NEEDS_RESCRAPE"
 
 print(json.dumps({
     "sampled": len(probe), "live": live, "dead": dead, "missing": missing,
-    "total": total, "with_image": len(with_img),
+    "placeholder": placeholder, "total": total, "with_image": len(with_img),
     "coverage": coverage, "live_frac": live_frac,
     "image_health": health, "relinked": relinked, "status": status
 }))

← ff30bdd deploy pierre_frey microsite -> DEPLOYED (401-gated, port 10  ·  back to Dw Vendor Microsites  ·  deploy-vendor: gate deploy on image_health>=0.5 (DEPLOY_FORC b0c4262 →