From 78912c68eb66f93677ed3e4e78625b774c3dfc53 Mon Sep 17 00:00:00 2001 From: BRADSEC <7948876+bradsec@users.noreply.github.com> Date: Fri, 30 Oct 2026 08:07:36 +1000 Subject: [PATCH] fix(decode): correct image size sniffing for WebP, JPEG and oriented PNG - Read lossless WebP (VP8L) dimensions after the 0x2f signature byte; they were read 3 bytes late, so lossless WebPs decoded distorted. - Slide the JPEG marker scan past the first 256 KB so metadata-heavy files (ICC profiles, extended XMP) are no longer rejected. - Never force both resize sides in decodeImage: Chromium applies PNG EXIF orientation and WebKit does not, so forcing both stretched rotated PNGs. Fitting images decode as-is; larger ones pass a width. --- index.html | 2 +- js/app.js | 2 +- js/pipeline.js | 33 ++++++++++++++---- scripts/cache-busters.json | 8 ++--- tests/pipeline.test.mjs | 68 ++++++++++++++++++++++++++++++++++++-- 5 files changed, 98 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index 0eccff3..9be7439 100644 --- a/index.html +++ b/index.html @@ -2007,6 +2007,6 @@