mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-16 23:24:22 +00:00
Tests: Rasterize Layer Style keeps a tagged CMYK document's inks (#4035)
#4035's only code change makes Rasterize Layer Style separate its RGB bake through the document's own CMYK profile, but none of its tests ran that command (they cover Flatten, Stamp and Merge, which already worked), so removing the change left every test green. New test: a tagged CMYK document's layer gets a drop shadow that falls off the canvas and is rasterized; the inks must come back within the profile's round trip. Without #4035's change they move by 35 levels (0.137) and the test fails; with it they pass at 8 and 16 bits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4aa7984eb0
commit
f9b4e677c4
1 file changed
+16
@@ -174,3 +174,19 @@ fn merge_visible_separates_through_the_document_profile() {
|
||||
assert!(d <= ROUND_TRIP, "{depth}-bit Merge Visible: inks moved by {d}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Rasterize Layer Style bakes the layer through the RGB composite and separates the result
|
||||
/// back: through the document's profile, the one the layer was read with (#3778), so the inks
|
||||
/// under the effect-free area come back within the profile's round trip. The drop shadow falls
|
||||
/// off the canvas, so every pixel checked is the layer's own.
|
||||
#[test]
|
||||
fn rasterize_layer_style_separates_through_the_document_profile() {
|
||||
for depth in [8, 16] {
|
||||
let d = drift(depth, true, 0, |s| {
|
||||
s.execute("layer.new.layerFromBackground", json!({})).unwrap();
|
||||
s.execute("layer.layerStyle.dropShadow", json!({"distance": 40, "size": 0})).unwrap();
|
||||
s.execute("layer.rasterize.layerStyle", json!({})).unwrap();
|
||||
});
|
||||
assert!(d <= ROUND_TRIP, "{depth}-bit Rasterize Layer Style: inks moved by {d}");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user