mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
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.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user