Skip to content

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

Merge upstream/main

Higgs32584eee57c02ce26
diff --cc crates/automation/src/workspace.rs
index 6919041b8,f73a70238..af33d7356
--- a/crates/automation/src/workspace.rs
+++ b/crates/automation/src/workspace.rs
@@@ -714,8 -716,12 +718,14 @@@ mod tests
assert!(authorize_desktop_engine_command("image.mode.cmyk", &serde_json::json!({})).is_err());
assert!(authorize_engine_command("image.mode.rgb", &serde_json::json!({"profile": "/outside/profile.icc"})).is_err());
assert!(authorize_engine_command("image.mode.rgb", &serde_json::json!({"profile": "srgb"})).is_ok());
+ assert!(authorize_engine_command("file.new", &serde_json::json!({"profile": "/outside/profile.icc"})).is_err());
+ assert!(authorize_engine_command("file.new", &serde_json::json!({"profile": "adobe-rgb-compat"})).is_ok());
+ // Shortcut sets: text in and out is fine; a path reads or writes the filesystem.
+ let ks = |p: serde_json::Value| authorize_engine_command("edit.keyboardShortcuts", &p);
+ assert!(ks(serde_json::json!({"exportKys": true, "summarize": true, "importKys": "<photoshop-keyboard-shortcuts/>"})).is_ok());
+ for key in ["importKys", "exportKys", "summarize"] {
+ assert!(ks(serde_json::json!({ key: {"path": "/outside/set.kys"} })).is_err(), "{key}");
+ }
assert!(authorize_engine_command("filter.distort.displace", &serde_json::json!({"mapPath": "outside.png"})).is_err());
assert!(authorize_engine_command("layer.setAdjustment", &serde_json::json!({"file": "outside.cube"})).is_err());
assert!(authorize_engine_command("prefs.set", &serde_json::json!({"path": "colorSettings.workingRgb", "value": "outside.icc"})).is_err());