From 3c8d24b275e684053acd6a8eb362ff48d8198ed1 Mon Sep 17 00:00:00 2001 From: Richard Geldreich Date: Fri, 23 Oct 2026 18:04:08 -0400 Subject: [PATCH] load_jpg: note the valid JPEGs the Wuffs loader rejects (16-bit quantization tables, truncated/no EOI, over 16384) Co-Authored-By: Claude Opus 5.5 --- encoder/basisu_enc.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/encoder/basisu_enc.cpp b/encoder/basisu_enc.cpp index bd6d80a..8af7da5 100644 --- a/encoder/basisu_enc.cpp +++ b/encoder/basisu_enc.cpp @@ -793,6 +793,9 @@ namespace basisu return load_png(buffer.data(), buffer.size(), img, pFilename); } + // With the Wuffs loader, Wuffs' accept/reject is final. Known valid JPEGs it rejects (and so we can't load): 16-bit (Pq=1) + // quantization tables ("jpeg: unsupported precision"), which libjpeg writes when a quantizer exceeds 255 and jpgd/libjpeg-turbo + // decode; also truncated files / files missing the EOI marker, and images over 16384 in either dimension. bool load_jpg(const char *pFilename, image& img) { #if BASISU_USE_WUFFS_LDR_LOADER