mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-15 22:52:35 +00:00
The 117,504 x 22,464 px banner from #8456 failed with "2639609856 pixels exceed max 1073741824": the decoder built the whole image in one buffer and the importer copied it into tiles, so the decode was capped at 2^30 px. - codecs: decode_ifd split into prepare + decode; new TiffBands decodes ~64 MiB groups of bands in parallel and hands each group, upright, to the caller. Limits::banded(): 300,000 px a side on 64-bit, max_alloc per group; 32-bit targets keep the whole-image check. - raster: Surface::try_write_interleaved (fallible, tiles on all cores). - io: import_tiff_page decodes flat pages through TiffBands straight into the layer, converting pieces of rows on all cores; layered TIFFs keep the whole-image path. Release, 20 threads: 36 MP 220 -> 52 ms; 30,000^2 6.8 s / 6.43 GB peak -> 1.1 s / 3.86 GB; 35,000^2 and the 2.64 GP banner now open (1.5 s, 3.3 s). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XNm5ZNBFtLZ2cZNaPnYsXV