You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Legal JPEG marker fill causes pixel billing to fall back to 16K tokens #6099
The lightweight JPEG scanner interprets a repeated FF byte as a length-bearing marker and skips the real frame header. Legal marker fill makes a small valid JPEG receive the 16,384-token unknown-image fallback, inflating preflight budgets.
Reproduction
At master 541cf26, encode a 40x24 JPEG and insert one FF before APP0 or three before SOF0. Jimp fully decodes both with correct dimensions, but decodeImageDims fails on the base. There are 13 passed / 2 failed.
Expected
Skip FF marker fill before interpreting the marker, retaining the bounded scan and malformed/truncated fallback. JPEG T.81 B.1.1.2 and E.2.1 define this behavior: https://www.w3.org/Graphics/JPEG/itu-t81.pdf
Prior work
Screened all 3,221 cached upstream PRs. #771/#1211/#1925/#3425 cover image billing, preprocessing and E2E tests, but not legal fill-byte runs in the lightweight dimension scanner. Previous Afloat16 PRs #6046–#6055 are excluded.
Activity
ranxianglei commentedon Nov 12, 2026
Fixed in batch PR #6439 (merged).