pdfcraft/crates/optimize/src
cyfung1031 be94112c8e
M11: strip redundant ASCII stream wrappers during optimization (#989)
* cos: decode only the first filter of a stream, strictly

Stream::decoded_first_filter_strict decodes the outer filter of a chain and leaves the rest of the chain encoded, within a caller bound. The optimizer uses it to remove an ASCII85 or ASCIIHex wrapper without inflating the inner data.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>

* optimize: strip redundant ASCII wrappers from filtered streams

A stream whose filter array starts with ASCII85Decode or ASCIIHexDecode loses that outer layer when the serialized replacement is smaller. The inner encoded bytes are kept exactly, and the decoded stream is unchanged. Streams with DecodeParms, image, object stream, or Crypt filters are left alone, as are streams whose wrapper fails strict decoding.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>

* optimize: document redundant ASCII-wrapper cleanup

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-11 13:21:20 -04:00
..
audit.rs Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
images.rs M11: Reduce file size shrinks office scans, and never saves a bigger copy (refs #490) (#849) 2026-10-10 16:20:50 -04:00
lib.rs M11: strip redundant ASCII stream wrappers during optimization (#989) 2026-10-11 13:21:20 -04:00
links.rs Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
unused.rs M11: Reduce file size and Optimize PDF drop images nothing draws, such as a deleted image (#894) 2026-10-10 16:21:07 -04:00