mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-12 08:50:53 -06:00
TIFF predictor 2 (ISO 32000-2 §7.4.4.4, Table 10) went through the bit-level BitChunks/BitWriter path for every bit depth, re-reading the previous output pixel through a new BitReader per pixel. Whole-byte samples (8 and 16 bits per component) are now undone on byte slices, each sample added to the same component of the pixel to its left, wrapping at its width; 1-, 2- and 4-bit samples keep the bit-level path. The output is byte-identical, including the dropped partial last row. A page of 45 full-page 8-bit grey images so predicted (PDFBOX-1350) renders in about 4 s instead of 23 s with the same pixels. Vendored hayro-syntax patch 42. Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn Co-authored-by: mtlcl410 <chuanlin@niar.org.tw> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>