forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 0bc6b65d3823aca0a66605d895e5c2d45b671fcdFiltered to crates/ec-image/src/upsample.rsClear filter

2026-08-14

feat(image): baseline and progressive JPEG decodingAhmet Kaan Gümüş · 7eed0e7
feat(image): baseline and progressive JPEG decoding

ITU-T T.81 baseline (SOF0), extended sequential (SOF1) and progressive
(SOF2), Huffman coded, with restart intervals and both spectral-selection
and successive-approximation refinement.

Chroma is upsampled with the triangle filter both reference decoders use,
in a module JPEG and WebP share: pixel replication is a decibel cheaper
against the source and puts a visible staircase on every saturated colour
edge. The IDCT is a separable fixed-point inversion carrying thirteen
fractional bits, which lands within one count of the incumbent on
grayscale, where no colour matrix or upsampler is in the way.

EXIF orientation is parsed and exposed, never applied — the same choice
the incumbent makes, so a caller swapping between them sees one picture.
Arithmetic-coded, lossless and hierarchical JPEGs, and the 4-component
CMYK/YCCK family, are refused by name with the reason: decoding ink
colours without their ICC profile looks right in a thumbnail and is wrong
in print.