Banner health: a size mismatch is a warning, not an auto-pause (the builder allows it)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -150,7 +150,8 @@ async function checkImage(src, size) {
|
||||
const mime = MAGIC(buf); const ms = Date.now() - t0;
|
||||
if (!mime) return { state: 'broken', note: /^text\/html/.test(type) ? 'The image address returns a web page, not an image' : 'The file is not a readable image', w: 0, h: 0, ms };
|
||||
const d = mime === 'image/webp' ? { w: 0, h: 0 } : bannerspin.dims(buf, mime);
|
||||
if (d.w && d.h && W && (d.w !== W || d.h !== H)) return { state: 'size', note: 'The image is ' + d.w + 'x' + d.h + '; this Banner Spin is ' + W + 'x' + H, w: d.w, h: d.h, ms };
|
||||
// a size mismatch is a warning, not a failure (2026-10-20): the builder allows it with a warning, so live banners must not be auto-paused for it
|
||||
if (d.w && d.h && W && (d.w !== W || d.h !== H)) return { state: 'ok', warn: 'size', note: 'The image is ' + d.w + 'x' + d.h + '; this Banner Spin is ' + W + 'x' + H, w: d.w, h: d.h, ms };
|
||||
return { state: 'ok', note: d.w ? '' : 'Loads as an image (size not readable)', w: d.w, h: d.h, ms };
|
||||
}
|
||||
// one banner target -> the spin-link check shape. A spin link only has to still exist.
|
||||
|
||||
Reference in New Issue
Block a user