[object Object]

← back to Dw Launches

Vendor-IG: fix double-proxy so cached IG images paint (60/60); preview local refs in compose strip

aef6a11d5f79cdbe15d0b87cfe3fc6d24e55d110 · 2026-06-19 15:43:46 -0700 · Steve

Files touched

Diff

commit aef6a11d5f79cdbe15d0b87cfe3fc6d24e55d110
Author: Steve <steve@designerwallcoverings.com>
Date:   Fri Jun 19 15:43:46 2026 -0700

    Vendor-IG: fix double-proxy so cached IG images paint (60/60); preview local refs in compose strip
---
 data/vendor-ig.json      |   4 ++--
 public/index.html        |  12 +++++++-----
 screenshot-vendor-ig.png | Bin 0 -> 696892 bytes
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/data/vendor-ig.json b/data/vendor-ig.json
index 37005ba..6197153 100644
--- a/data/vendor-ig.json
+++ b/data/vendor-ig.json
@@ -71,7 +71,7 @@
       "name": "Farrow & Ball"
     },
     {
-      "handle": "zoffanyofficial",
+      "handle": "zoffany",
       "vendor": "Zoffany",
       "name": "Zoffany"
     },
@@ -81,7 +81,7 @@
       "name": "Scalamandré"
     },
     {
-      "handle": "gpandjbaker",
+      "handle": "gpjbaker",
       "vendor": "GP & J Baker",
       "name": "GP & J Baker"
     },
diff --git a/public/index.html b/public/index.html
index 4410a75..e034a88 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1299,7 +1299,7 @@ function renderMediaInto(elId, arr){
   arr.forEach((m,i)=>{
     const d=document.createElement('div'); d.className='media-item';
     const label=m.name||m.ref.split('/').pop()||m.type;
-    d.innerHTML = m.type==='image' && /^blob:|^https?:/.test(m.ref)
+    d.innerHTML = m.type==='image' && /^blob:|^https?:|^\/api\//.test(m.ref)
       ? `<img src="${m.ref}" alt="">` : `<span>${m.type}<br>${label.slice(0,18)}</span>`;
     d.innerHTML += `<span class="x" title="remove">×</span><span class="tag">${m.type}</span>`;
     d.querySelector('.x').onclick=(e)=>{e.stopPropagation();arr.splice(i,1);refreshMedia();};
@@ -1667,9 +1667,10 @@ function mlCard(m){
   const c=document.createElement('div'); c.className='ml-card';
   const srcLabel={shopify:'Shopify',instagram:'Instagram',vendor:'Vendor IG'}[m.source]||m.source;
   const safe=s=>(s||'').replace(/"/g,'&quot;').replace(/</g,'&lt;');
-  const proxied='/api/media/img?u='+encodeURIComponent(m.url);
-  // vendor/IG images are hotlink-blocked or expiring → load via proxy/cache up
-  // front. Shopify CDN is fast+public → load direct, fall back to proxy on error.
+  // vendor IG urls are ALREADY a local cached path (/api/media/img?u=…) — use
+  // as-is. http(s) urls: shopify CDN loads direct (fast); others via the proxy.
+  const isLocal = /^\//.test(m.url);
+  const proxied = isLocal ? m.url : '/api/media/img?u='+encodeURIComponent(m.url);
   const initialSrc = (m.source==='shopify') ? safe(m.url) : proxied;
   c.innerHTML=
     `<span class="src">${srcLabel}</span>`+
@@ -1682,7 +1683,8 @@ function mlCard(m){
   // proxy fallback on load error (one retry), then dim.
   const img=c.querySelector('img.thumb');
   img.onerror=function(){
-    if(this.dataset.proxied==='0'){ this.dataset.proxied='1'; this.src='/api/media/img?u='+encodeURIComponent(this.dataset.raw); }
+    const raw=this.dataset.raw;
+    if(this.dataset.proxied==='0' && /^https?:/.test(raw)){ this.dataset.proxied='1'; this.src='/api/media/img?u='+encodeURIComponent(raw); }
     else { this.style.opacity=.2; this.alt='(image unavailable)'; this.onerror=null; }
   };
   c.querySelector('.att').onclick=(e)=>{
diff --git a/screenshot-vendor-ig.png b/screenshot-vendor-ig.png
new file mode 100644
index 0000000..b0ef624
Binary files /dev/null and b/screenshot-vendor-ig.png differ

← 626db0f Vendor-IG: Browserbase+Picuki ingest live — 73 real IG image  ·  back to Dw Launches  ·  Vendor-IG: corrected handles (arte=artewalls, cole&son, thib 94376a2 →