[object Object]

← back to Dw Kravet Hires

TK-11740: PNG dim-cap (bound=3000) + longer processing poll — fixes final 8

80f62c84791043c4c370cbdae8b7bbe96fded027 · 2026-09-14 16:48:52 -0700 · Steve Abrams

Second live run: 76/84 landed; 8 self-healed. Root causes: (a) 6 .CAC PNG sources stay ~20MB
even resized because Brandfolder ignores &quality/&format on PNG (lossless) -> cap PNG dims to
3000px (~11-15MB); (b) 2 valid JPEGs false-healed on the 45s processing poll -> bump poll to 75s.
JPEG sources keep quality=90@4472. Already-live products race-skip on re-run.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R9NqWUYGborGRqS4NMyA13

Files touched

Diff

commit 80f62c84791043c4c370cbdae8b7bbe96fded027
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Sep 14 16:48:52 2026 -0700

    TK-11740: PNG dim-cap (bound=3000) + longer processing poll — fixes final 8
    
    Second live run: 76/84 landed; 8 self-healed. Root causes: (a) 6 .CAC PNG sources stay ~20MB
    even resized because Brandfolder ignores &quality/&format on PNG (lossless) -> cap PNG dims to
    3000px (~11-15MB); (b) 2 valid JPEGs false-healed on the 45s processing poll -> bump poll to 75s.
    JPEG sources keep quality=90@4472. Already-live products race-skip on re-run.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01R9NqWUYGborGRqS4NMyA13
---
 data/kravet-hires-oversized-subset-map.json | 43 +++++++++++++++--------------
 scripts/apply-hires.mjs                     |  2 +-
 scripts/build-oversized-subset.mjs          | 20 +++++++++-----
 3 files changed, 37 insertions(+), 28 deletions(-)

diff --git a/data/kravet-hires-oversized-subset-map.json b/data/kravet-hires-oversized-subset-map.json
index 81eb6ee..d05d8b2 100644
--- a/data/kravet-hires-oversized-subset-map.json
+++ b/data/kravet-hires-oversized-subset-map.json
@@ -1,11 +1,14 @@
 {
  "ticket": "TK-11740",
  "parent_ticket": "TK-11658",
- "generated_at": "2026-09-14T23:25:27.532Z",
+ "generated_at": "2026-09-14T23:48:31.894Z",
  "generated_by": "night-TK-11740",
  "store": "designer-laboratory-sandbox.myshopify.com",
  "scope": "The oversized-source residual variants from TK-11658 whose Brandfolder source is FETCHABLE; proposed_hires_url resized to <=4472px (<=20MP) via Brandfolder CDN ?width=4472&height=4472&fit=bound. Excludes 28 broken-source variants (see data/hires-broken-source.txt) that need a re-scrape.",
- "resize_param": "?width=4472&height=4472&fit=bound&quality=90",
+ "resize_param": {
+  "jpeg": "?width=4472&height=4472&fit=bound&quality=90",
+  "png": "?width=3000&height=3000&fit=bound"
+ },
  "residual_total": 112,
  "excluded_broken_source": 28,
  "rollback": "apply adds the hi-res media and re-points featuredImage; rollback re-points featuredImage to the retained rollback_url/old media id. Fully reversible per product.",
@@ -842,12 +845,12 @@
    "mfr_sku": "W0116/01.CAC.0",
    "cur_width": 400,
    "current_400px_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0116_01_CAC_405d495a-1c91-4dff-8d58-6f3557d48b7a.jpg?v=1753321673",
-   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/sfx663f6kpggtz8pprvgxj/W011601_CAC.png?width=4472&height=4472&fit=bound&quality=90",
+   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/sfx663f6kpggtz8pprvgxj/W011601_CAC.png?width=3000&height=3000&fit=bound",
    "hires_source": "kravet_sku_images",
    "swappable_from_local_staging": true,
    "rollback_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0116_01_CAC_405d495a-1c91-4dff-8d58-6f3557d48b7a.jpg?v=1753321673",
    "original_oversized_url": "https://cdn.brandfolder.io/XSDLGRW8/at/sfx663f6kpggtz8pprvgxj/W011601_CAC.png",
-   "resize_param": "?width=4472&height=4472&fit=bound&quality=90",
+   "resize_param": "?width=3000&height=3000&fit=bound",
    "subset_ticket": "TK-11740"
   },
   {
@@ -857,12 +860,12 @@
    "mfr_sku": "W0116/02.CAC.0",
    "cur_width": 400,
    "current_400px_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0116_02_CAC_1bf820d2-6fea-4954-9d88-e202e8f10e8d.jpg?v=1753321672",
-   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/hmv3fptqpbvbwnrwv4pc4q/W011602_CAC.png?width=4472&height=4472&fit=bound&quality=90",
+   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/hmv3fptqpbvbwnrwv4pc4q/W011602_CAC.png?width=3000&height=3000&fit=bound",
    "hires_source": "kravet_sku_images",
    "swappable_from_local_staging": true,
    "rollback_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0116_02_CAC_1bf820d2-6fea-4954-9d88-e202e8f10e8d.jpg?v=1753321672",
    "original_oversized_url": "https://cdn.brandfolder.io/XSDLGRW8/at/hmv3fptqpbvbwnrwv4pc4q/W011602_CAC.png",
-   "resize_param": "?width=4472&height=4472&fit=bound&quality=90",
+   "resize_param": "?width=3000&height=3000&fit=bound",
    "subset_ticket": "TK-11740"
   },
   {
@@ -872,12 +875,12 @@
    "mfr_sku": "W0116/03.CAC.0",
    "cur_width": 400,
    "current_400px_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0116_03_CAC_279643c2-40dc-407c-87eb-beda1af8d489.jpg?v=1753321670",
-   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/wmfhfmc53q77f693rvffxmns/W011603_CACb.png?width=4472&height=4472&fit=bound&quality=90",
+   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/wmfhfmc53q77f693rvffxmns/W011603_CACb.png?width=3000&height=3000&fit=bound",
    "hires_source": "kravet_sku_images",
    "swappable_from_local_staging": true,
    "rollback_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0116_03_CAC_279643c2-40dc-407c-87eb-beda1af8d489.jpg?v=1753321670",
    "original_oversized_url": "https://cdn.brandfolder.io/XSDLGRW8/at/wmfhfmc53q77f693rvffxmns/W011603_CACb.png",
-   "resize_param": "?width=4472&height=4472&fit=bound&quality=90",
+   "resize_param": "?width=3000&height=3000&fit=bound",
    "subset_ticket": "TK-11740"
   },
   {
@@ -887,12 +890,12 @@
    "mfr_sku": "W0118/01.CAC.0",
    "cur_width": 400,
    "current_400px_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0118_01_CAC_1a02241c-26e0-4319-b450-81a28c2e4931.jpg?v=1753321660",
-   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/wvnspcck339gh8tb3pnspq64/W011801_CAC.png?width=4472&height=4472&fit=bound&quality=90",
+   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/wvnspcck339gh8tb3pnspq64/W011801_CAC.png?width=3000&height=3000&fit=bound",
    "hires_source": "kravet_sku_images",
    "swappable_from_local_staging": true,
    "rollback_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0118_01_CAC_1a02241c-26e0-4319-b450-81a28c2e4931.jpg?v=1753321660",
    "original_oversized_url": "https://cdn.brandfolder.io/XSDLGRW8/at/wvnspcck339gh8tb3pnspq64/W011801_CAC.png",
-   "resize_param": "?width=4472&height=4472&fit=bound&quality=90",
+   "resize_param": "?width=3000&height=3000&fit=bound",
    "subset_ticket": "TK-11740"
   },
   {
@@ -902,12 +905,12 @@
    "mfr_sku": "W0118/03.CAC.0",
    "cur_width": 400,
    "current_400px_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0118_03_CAC_7b9a8533-a678-4e8b-a0a9-eec9d2e76470.jpg?v=1753321656",
-   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/3pqmhm33rxkhppmwhnf3rznw/W011803_CAC.png?width=4472&height=4472&fit=bound&quality=90",
+   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/3pqmhm33rxkhppmwhnf3rznw/W011803_CAC.png?width=3000&height=3000&fit=bound",
    "hires_source": "kravet_sku_images",
    "swappable_from_local_staging": true,
    "rollback_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0118_03_CAC_7b9a8533-a678-4e8b-a0a9-eec9d2e76470.jpg?v=1753321656",
    "original_oversized_url": "https://cdn.brandfolder.io/XSDLGRW8/at/3pqmhm33rxkhppmwhnf3rznw/W011803_CAC.png",
-   "resize_param": "?width=4472&height=4472&fit=bound&quality=90",
+   "resize_param": "?width=3000&height=3000&fit=bound",
    "subset_ticket": "TK-11740"
   },
   {
@@ -917,12 +920,12 @@
    "mfr_sku": "W0118/04.CAC.0",
    "cur_width": 400,
    "current_400px_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0118_04_CAC_6a34c4d3-e303-4b97-83a6-1f57a0fef7ed.jpg?v=1753321654",
-   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/jb37ngkg58fw4rgg7qkvbnq/W011804_CAC.png?width=4472&height=4472&fit=bound&quality=90",
+   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/jb37ngkg58fw4rgg7qkvbnq/W011804_CAC.png?width=3000&height=3000&fit=bound",
    "hires_source": "kravet_sku_images",
    "swappable_from_local_staging": true,
    "rollback_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0118_04_CAC_6a34c4d3-e303-4b97-83a6-1f57a0fef7ed.jpg?v=1753321654",
    "original_oversized_url": "https://cdn.brandfolder.io/XSDLGRW8/at/jb37ngkg58fw4rgg7qkvbnq/W011804_CAC.png",
-   "resize_param": "?width=4472&height=4472&fit=bound&quality=90",
+   "resize_param": "?width=3000&height=3000&fit=bound",
    "subset_ticket": "TK-11740"
   },
   {
@@ -932,12 +935,12 @@
    "mfr_sku": "W0118/05.CAC.0",
    "cur_width": 400,
    "current_400px_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0118_05_CAC_5a475edc-f040-4565-b057-67efc10218df.jpg?v=1753321653",
-   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/nt3662qgv8sww472n6j2jmx/W011805_CAC.png?width=4472&height=4472&fit=bound&quality=90",
+   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/nt3662qgv8sww472n6j2jmx/W011805_CAC.png?width=3000&height=3000&fit=bound",
    "hires_source": "kravet_sku_images",
    "swappable_from_local_staging": true,
    "rollback_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0118_05_CAC_5a475edc-f040-4565-b057-67efc10218df.jpg?v=1753321653",
    "original_oversized_url": "https://cdn.brandfolder.io/XSDLGRW8/at/nt3662qgv8sww472n6j2jmx/W011805_CAC.png",
-   "resize_param": "?width=4472&height=4472&fit=bound&quality=90",
+   "resize_param": "?width=3000&height=3000&fit=bound",
    "subset_ticket": "TK-11740"
   },
   {
@@ -947,12 +950,12 @@
    "mfr_sku": "W0119/03.CAC.0",
    "cur_width": 400,
    "current_400px_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0119_03_CAC_2d46088a-8695-4375-b8c7-4c53159368b7.jpg?v=1753321647",
-   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/fq6bn8j8p6g9wqk3tt7hjf/W011903_CAC.png?width=4472&height=4472&fit=bound&quality=90",
+   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/fq6bn8j8p6g9wqk3tt7hjf/W011903_CAC.png?width=3000&height=3000&fit=bound",
    "hires_source": "kravet_sku_images",
    "swappable_from_local_staging": true,
    "rollback_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0119_03_CAC_2d46088a-8695-4375-b8c7-4c53159368b7.jpg?v=1753321647",
    "original_oversized_url": "https://cdn.brandfolder.io/XSDLGRW8/at/fq6bn8j8p6g9wqk3tt7hjf/W011903_CAC.png",
-   "resize_param": "?width=4472&height=4472&fit=bound&quality=90",
+   "resize_param": "?width=3000&height=3000&fit=bound",
    "subset_ticket": "TK-11740"
   },
   {
@@ -962,12 +965,12 @@
    "mfr_sku": "W0119/05.CAC.0",
    "cur_width": 400,
    "current_400px_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0119_05_CAC_f7681c05-4e45-4c5a-83c9-1b1c78d0953d.jpg?v=1753321644",
-   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/g9k89zvghm5b9t9p4sx3mcj/W011905_CAC.png?width=4472&height=4472&fit=bound&quality=90",
+   "proposed_hires_url": "https://cdn.brandfolder.io/XSDLGRW8/at/g9k89zvghm5b9t9p4sx3mcj/W011905_CAC.png?width=3000&height=3000&fit=bound",
    "hires_source": "kravet_sku_images",
    "swappable_from_local_staging": true,
    "rollback_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0119_05_CAC_f7681c05-4e45-4c5a-83c9-1b1c78d0953d.jpg?v=1753321644",
    "original_oversized_url": "https://cdn.brandfolder.io/XSDLGRW8/at/g9k89zvghm5b9t9p4sx3mcj/W011905_CAC.png",
-   "resize_param": "?width=4472&height=4472&fit=bound&quality=90",
+   "resize_param": "?width=3000&height=3000&fit=bound",
    "subset_ticket": "TK-11740"
   },
   {
diff --git a/scripts/apply-hires.mjs b/scripts/apply-hires.mjs
index 3381532..589534e 100644
--- a/scripts/apply-hires.mjs
+++ b/scripts/apply-hires.mjs
@@ -185,7 +185,7 @@ async function applyLive(rows) {
 
         // 3) poll processing; self-heal if it never reaches READY
         let st = 'PROCESSING', tries = 0;
-        while ((st === 'PROCESSING' || st === 'UPLOADED') && tries++ < 15) {
+        while ((st === 'PROCESSING' || st === 'UPLOADED') && tries++ < 25) {   // 75s (was 45s) — large valid images were false-healing on slow processing
           await sleep(3000);
           const q = await shopify(`query($id:ID!){ node(id:$id){ ... on MediaImage{ status } } }`, { id: newMediaId });
           st = q.node?.status || st;
diff --git a/scripts/build-oversized-subset.mjs b/scripts/build-oversized-subset.mjs
index fbad614..0544191 100644
--- a/scripts/build-oversized-subset.mjs
+++ b/scripts/build-oversized-subset.mjs
@@ -20,10 +20,15 @@ const MAP = path.join(PROJ, 'data/kravet-hires-swap-map.json');
 const RESID = path.join(PROJ, 'data/hires-oversized-residual.txt');
 const BROKEN = path.join(PROJ, 'data/hires-broken-source.txt');
 const OUT = path.join(PROJ, 'data/kravet-hires-oversized-subset-map.json');
-// <=20MP (both edges <=4472) AND <20MB file. fit=bound alone kept 4472px but the JPEG came back
-// ~24MB (over Shopify's 20MB BYTE limit) → media processing FAILED for 53/84 on the first live run.
-// &quality=90 compresses to ~6MB worst-case, full dims retained. (TK-11740, 2026-09-14.)
-const RESIZE = '?width=4472&height=4472&fit=bound&quality=90';
+// Shopify media limits are BOTH <=20MP (dims) AND <=20MB (file bytes). fit=bound caps dims but
+// the delivered file must also stay <20MB. Two source classes need different params:
+//   JPEG: &quality=90 at 4472px → ~6MB (lossy compresses well; full 20MP retained).
+//   PNG : Brandfolder IGNORES &quality AND &format on PNG (stays lossless ~1.6 B/px), so a 4472px
+//         PNG is ~20-24MB → fails. Cap DIMENSIONS to 3000px instead → ~11-15MB, aspect preserved.
+// (TK-11740, 2026-09-14: first run failed 53 on the 20MB byte limit; PNGs need the dim cap.)
+const RESIZE_JPEG = '?width=4472&height=4472&fit=bound&quality=90';
+const RESIZE_PNG  = '?width=3000&height=3000&fit=bound';
+const resizeFor = (src) => (/\.png(\?|$)/i.test(src) ? RESIZE_PNG : RESIZE_JPEG);
 
 const doc = JSON.parse(fs.readFileSync(MAP, 'utf8'));
 const byMfr = new Map(doc.rows.map((r) => [r.mfr_sku, r]));
@@ -44,8 +49,9 @@ const rows = fixable.map((k) => {
   if (!r.swappable_from_local_staging) throw new Error(`not swappable: ${k}`);
   const src = r.proposed_hires_url;
   if (src.includes('?')) throw new Error(`source already has query string: ${k} ${src}`);
-  return { ...r, proposed_hires_url: src + RESIZE,
-    original_oversized_url: src, resize_param: RESIZE, subset_ticket: 'TK-11740' };
+  const rp = resizeFor(src);
+  return { ...r, proposed_hires_url: src + rp,
+    original_oversized_url: src, resize_param: rp, subset_ticket: 'TK-11740' };
 });
 
 const out = {
@@ -55,7 +61,7 @@ const out = {
   generated_by: process.env.TK_AGENT || 'night-TK-11740',
   store: doc.store,
   scope: `The oversized-source residual variants from TK-11658 whose Brandfolder source is FETCHABLE; proposed_hires_url resized to <=4472px (<=20MP) via Brandfolder CDN ?width=4472&height=4472&fit=bound. Excludes ${broken.size} broken-source variants (see data/hires-broken-source.txt) that need a re-scrape.`,
-  resize_param: RESIZE,
+  resize_param: { jpeg: RESIZE_JPEG, png: RESIZE_PNG },
   residual_total: resid.length,
   excluded_broken_source: broken.size,
   rollback: doc.rollback,

← ce21d47 auto-data-snapshot: 2026-09-14T16:46:18 (1 data files) — dat  ·  back to Dw Kravet Hires  ·  TK-11658: verify 247 'absent' -> 246 valid-lowres (NO draft 1b214f2 →