From 096544db40827cdee928e1a5603bc7ce30847605 Mon Sep 17 00:00:00 2001 From: 00xJ0 <56056764+00xJ0@users.noreply.github.com> Date: Mon, 19 Oct 2026 13:03:25 -0700 Subject: [PATCH] Test: Press Quality keeps a CMYK image's inks in an RGB document (#3012 review) The colour space alone could pass a conversion that changed the inks: the exported image is opened again and its inks compared with the ones placed. --- crates/pdf/src/tests_cmykimages.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/pdf/src/tests_cmykimages.rs b/crates/pdf/src/tests_cmykimages.rs index b9fdc26dd..67e67f26c 100644 --- a/crates/pdf/src/tests_cmykimages.rs +++ b/crates/pdf/src/tests_cmykimages.rs @@ -462,8 +462,14 @@ fn press_quality_writes_cmyk_in_an_rgb_document_too() { for (what, blob) in [("CMYK image", tiff), ("RGB image", png_blob)] { let mut d = image_doc(blob, 4, 4); d.color_mode = ColorMode::Rgb; - let w = written(&export_with_report(&d, &press()).unwrap().bytes); + let out = export_with_report(&d, &press()).unwrap(); + let w = written(&out.bytes); assert_eq!(w.len(), 1, "{what}: {w:?}"); assert_eq!(w[0].space, "DeviceCMYK", "{what} in an RGB document"); + // Preserve Numbers: the CMYK image comes back with the inks it had. + if what == "CMYK image" { + let back = import(&out.bytes).unwrap(); + assert_eq!(all_images(&back)[0].cmyk().unwrap().data, flat(ink, 16), "{what} inks"); + } } }