Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Layered TIFF corpus test: a flat Duotone is expected with its inks rendered

Gert Pellina75039792e05
diff --git a/crates/io/tests/tiff_corpus.rs b/crates/io/tests/tiff_corpus.rs
index 143e75bea..697eab6d3 100644
--- a/crates/io/tests/tiff_corpus.rs
+++ b/crates/io/tests/tiff_corpus.rs
@@ -114,6 +114,14 @@ fn corpus_round_trips_through_layered_tiff() {
let expected: Document = {
let mut d = oracle.clone();
d.channels.clear();
+ // A flat Duotone is written as its inks rendered in RGB (as for any flat format).
+ if flat
+ && d.mode == photocraft_color::ColorMode::Duotone
+ && let Some(duo) = d.duotone.take()
+ {
+ d.layers.push(Layer::new("Duotone", photocraft_doc::LayerContent::Adjustment(duo.display_adjustment())));
+ d.mode = photocraft_color::ColorMode::Rgb;
+ }
d
};
let x = photocraft_compose::flatten(&expected).px;