mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-31 21:48:09 -06:00
Stream::decoded reads only direct parameter dictionaries, so an image whose /DecodeParms is a reference (whole, or as array entries) was decoded without its predictor. For a 1-bit image with a PNG predictor the rows came out shifted by their tag bytes, Group 4 of that was still smaller, and the picture was replaced by a skewed one; resampling and merging image strips read the same way. pdfcraft_cos::Document::with_direct_parms gives the stream with the parameters its filters use made direct: only the entries at the filters' places, and none for a chain longer than any decoder takes, so at most MAX_CHAIN objects are copied. The optimizer's pixels() and the Group 4 step decode through it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BfMGHQNgdq5yf5tKZHGR3z