From a4058c92425d84162263b73439d4c74f5f32ff00 Mon Sep 17 00:00:00 2001 From: Grzegorz Martens Date: Mon, 26 Oct 2026 17:05:28 +0100 Subject: [PATCH] M11: say redaction removes Create PDF's Group 4 pictures whole for now Redaction doesn't decode CCITT yet, so a mark over part of a picture Create PDF stored as Group 4 removes the whole picture (nothing leaks); before this PR such pictures were eight-bit Flate and had only the covered pixels cleared. The create README and the image-to-PDF parity note say so; #4384 adds CCITT to redaction. The workspace's comment on hayro-ccitt says Export uses it, not only tests. From reviews with the pdfcraft-review skill. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01P6yUtvWGPsJpMLyh6pxSXG --- Cargo.toml | 3 ++- crates/create/README.md | 4 +++- parity/acrobat-features.toml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5a92b67475..b2380a7496 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,7 +67,8 @@ flate2 = { version = "1.1", default-features = false, features = ["rust_backend" weezl = "0.2" # CCITT Group 4 encoding (pdfcraft-filters); already in the tree through tiff. fax = "0.2.7" -# An independent CCITT decoder, for round-trip tests; already in the tree through hayro. +# A CCITT decoder: Export ▸ Images decodes fax images with it, and the encoder's round-trip tests +# check against it; already in the tree through hayro. hayro-ccitt = "0.3" # foundation diff --git a/crates/create/README.md b/crates/create/README.md index 8e0bdc68be..14d42e0a18 100644 --- a/crates/create/README.md +++ b/crates/create/README.md @@ -8,7 +8,9 @@ Layer L4. Create a PDF (Acrobat's Create a PDF tool), execution plan M10.2: (`/DCTDecode`, grey, RGB or Adobe-inverted CMYK); PNG is decoded and stored with Flate, with transparency as a soft mask. A picture of only pure black and white (a 1-bit PNG or TIFF, eight-bit grey, a two-colour palette, RGB without a profile) is stored at one bit per pixel, as - CCITT Group 4 or Flate, whichever is smaller as stored (`pdfcraft_filters::encode_g4`). An ICC profile in the file (JPEG `APP2 ICC_PROFILE`, PNG + CCITT Group 4 or Flate, whichever is smaller as stored (`pdfcraft_filters::encode_g4`). + Redaction doesn't decode Group 4 yet: a mark over part of such a picture removes the whole + picture (nothing leaks). An ICC profile in the file (JPEG `APP2 ICC_PROFILE`, PNG `iCCP`) that matches the image's colour space is kept as an `/ICCBased` colour space with the device space as `/Alternate`; images with the same profile share one profile object. JPEG metadata scanning skips marker fill bytes and reads application segments after the diff --git a/parity/acrobat-features.toml b/parity/acrobat-features.toml index 81c971dbc8..7310893697 100644 --- a/parity/acrobat-features.toml +++ b/parity/acrobat-features.toml @@ -6885,7 +6885,7 @@ status = "shipped" commands = ["create.images"] tools = ["doc_create"] evidence = ["crates/create/src/tests.rs::black_and_white_images_are_stored_at_one_bit", "crates/create/src/tests.rs::jpeg_2000_images_are_embedded_as_is", "crates/create/src/tests.rs::images_export_as_jpeg_unchanged_and_others_as_png", "crates/create/src/tests.rs::embedded_icc_profiles_tag_the_image_colour_space"] -notes = "PNG, JPEG, TIFF (multi-page), GIF (first frame), BMP, and JPEG 2000 (JP2 or codestream, embedded as JPXDecode with its capture resolution). JPEG and PNG ICC profiles are kept as /ICCBased; TIFF profiles are not read yet. A picture of only pure black and white (a 1-bit PNG or TIFF, eight-bit grey, a two-colour palette, RGB without a profile) is stored at one bit per pixel, as CCITT Group 4 or Flate, whichever is smaller" +notes = "PNG, JPEG, TIFF (multi-page), GIF (first frame), BMP, and JPEG 2000 (JP2 or codestream, embedded as JPXDecode with its capture resolution). JPEG and PNG ICC profiles are kept as /ICCBased; TIFF profiles are not read yet. A picture of only pure black and white (a 1-bit PNG or TIFF, eight-bit grey, a two-colour palette, RGB without a profile) is stored at one bit per pixel, as CCITT Group 4 or Flate, whichever is smaller. Redaction doesn't decode Group 4 yet: a mark over part of such a picture removes it whole (nothing leaks)" [[feature]] id = "create.from-multipage-tiff"