From 6e909558c183c3c99a604f21e24be97b7dbc421c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 3 Nov 2026 09:59:55 -0800 Subject: [PATCH] PDF: compile the CCITT row helper only with images --- vendor/README.craft-reader.md | 3 +++ vendor/hayro-syntax/SOURCE.json | 2 +- vendor/hayro-syntax/src/filter/mod.rs | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/vendor/README.craft-reader.md b/vendor/README.craft-reader.md index 6967ee6f..081229c2 100644 --- a/vendor/README.craft-reader.md +++ b/vendor/README.craft-reader.md @@ -321,6 +321,9 @@ products match its vertices (moving the points alone skewed barycentric coordina `restore_state` doesn't when the saved-state bound skipped the save; and a resolved JP2 palette decodes to 8 bits whatever `/BitsPerComponent` the dictionary gives. +`hayro-syntax` compiles `filter::ccitt_max_rows` and its unit tests only with the +`images` feature, matching `filter::ccitt`. + This remains the patched 0.7 backend. It retains the existing Bradford Lab conversion, floating component precision and codec versions, rather than claiming full 0.8 equivalence. The independent color oracles, backend tests and facade contracts cover diff --git a/vendor/hayro-syntax/SOURCE.json b/vendor/hayro-syntax/SOURCE.json index f2577bd3..820ae09c 100644 --- a/vendor/hayro-syntax/SOURCE.json +++ b/vendor/hayro-syntax/SOURCE.json @@ -176,7 +176,7 @@ "path": "src/filter/mod.rs", "source_sha256": "0af7145ab16b15b7a60c4b57efecb9bd5fd0cfdc9bb5f9388abb695386e63e49", "source_git_blob": "06bda29487d62c25dc39c1ee109091cb17e3867f", - "sha256": "727fd21fe968d0ce9de54ea0c50658af43658289f9b38b27fbc74596e48d0d4b" + "sha256": "a3bf1dbe731aca35808ec7f22f1d58bb5f0f4e3ce9087260d1e38800baf33bd8" }, { "path": "src/filter/run_length.rs", diff --git a/vendor/hayro-syntax/src/filter/mod.rs b/vendor/hayro-syntax/src/filter/mod.rs index 9da38e20..30b3fae6 100644 --- a/vendor/hayro-syntax/src/filter/mod.rs +++ b/vendor/hayro-syntax/src/filter/mod.rs @@ -176,13 +176,14 @@ const MAX_CCITT_PIXELS: u64 = 1 << 28; /// PdfCraft patch: the most rows of `columns` pixels, `row_bytes` bytes each once decoded, that fit /// both `limit` bytes and the pixel cap; at least one when one row fits. +#[cfg(feature = "images")] pub(crate) fn ccitt_max_rows(columns: u32, row_bytes: u32, limit: usize) -> u32 { let by_pixels = MAX_CCITT_PIXELS / u64::from(columns.max(1)); let by_bytes = u64::try_from(limit).unwrap_or(u64::MAX) / u64::from(row_bytes.max(1)); u32::try_from(by_pixels.min(by_bytes)).unwrap_or(u32::MAX) } -#[cfg(test)] +#[cfg(all(test, feature = "images"))] mod ccitt_tests { use super::ccitt_max_rows;