mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-14 14:22:39 +00:00
A placed JPEG drawn at a fraction of its pixel size was decoded at full size first and then halved down to the level the screen needs. For a 24 MP photo that is a 96 MB decode per image, and with several such images on a page the decoded pixels outgrow the image cache. A YCbCr or grayscale JPEG whose wanted level is a half, a quarter or an eighth of its size (or smaller) is now decoded at that size straight from its compressed blocks with jpeg-decoder's scaled IDCT, cut to the size the halving path gives the same level, and halved from there for smaller levels. The embedded ICC profile is applied as in a full decode. CMYK and YCCK JPEGs, other formats and the full size still decode in full.