fix(engine): expose transparent param in comp.saveFrameAs schema and test execute_checked

This commit is contained in:
Kushagra Kumar committed 2026-10-25 18:44:35 +05:30
1 parent f7922a9fba
commit 77e2cf0554
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -235,7 +235,7 @@ pub fn specs() -> Vec<CommandSpec> {
"File...",
["Composition", "Save Frame As"],
Some("Cmd+Alt+S"),
"{path (.png; with queue: an output path or template), time?, scale?, queue?: bool (add a Render Queue item from the Frame Default templates instead of writing now)}",
"{path (.png; with queue: an output path or template), time?, scale?, queue?: bool (add a Render Queue item from the Frame Default templates instead of writing now), transparent?: bool (default true)}",
has_comp,
save_frame
),
+1 -1
View File
@@ -184,7 +184,7 @@ fn save_frame_as_png_preserves_alpha_channel() {
assert_eq!(empty_px[3], 0, "outside solid region must have alpha 0: {empty_px:?}");
let flat_path = dir.join("flat.png").to_string_lossy().to_string();
s.execute("comp.saveFrameAs", json!({"path": flat_path, "transparent": false})).unwrap();
s.execute_checked("comp.saveFrameAs", json!({"path": flat_path, "transparent": false})).unwrap();
let flat_img = image::load_from_memory(&std::fs::read(&flat_path).unwrap()).unwrap().to_rgba8();
let flat_empty_px = flat_img.get_pixel(24, 24);
assert_eq!(flat_empty_px[3], 255, "transparent: false must composite over background: {flat_empty_px:?}");