Skip to content

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

Integration: track t16

aiongg0e801563970d
diff --cc apps/photocraft-cli/src/lib.rs
index def94cc8d,b8c77c344..ea9dc8523
--- a/apps/photocraft-cli/src/lib.rs
+++ b/apps/photocraft-cli/src/lib.rs
@@@ -15,22 -15,24 +15,25 @@@ pub const USAGE: &str = "
photocraft-cli: headless PhotoCraft
USAGE:
- photocraft-cli convert <in> <out> [--format <ext>] [--quality <1-100>] [--tiff-layers] [--tiff-compression <none|lzw|zip>] [--tga-bits <24|32>] [--dpx-bits <8|10|12|16>] [--dds-compression <none|bc1|bc2|bc3>] [--dds-mipmaps]
- photocraft-cli convert <in> <out> [--format <ext>] [--quality <1-100>] [--tiff-layers] [--tga-bits <24|32>] [--dpx-bits <8|10|12|16>] [--dds-compression <none|bc1|bc2|bc3>] [--dds-mipmaps] [--jpeg-format <baseline|optimized|progressive>]
++ photocraft-cli convert <in> <out> [--format <ext>] [--quality <1-100>] [--tiff-layers] [--tiff-compression <none|lzw|zip>] [--tga-bits <24|32>] [--dpx-bits <8|10|12|16>] [--dds-compression <none|bc1|bc2|bc3>] [--dds-mipmaps] [--jpeg-format <baseline|optimized|progressive>]
Convert between formats (.pcraft, .psd, .png, .jpg, .tif, .webp, .exr, …).
- TIFF output is flat unless --tiff-layers keeps the layers (Photoshop layer data).
+ TIFF output is flat unless --tiff-layers keeps the layers (Photoshop layer data);
+ --tiff-compression compresses it (none, the default; lzw; zip).
--quality sets the JPEG or WebP quality; a WebP written with a quality is lossy, without one lossless.
--tga-bits sets a TGA's bits per pixel: 32 writes the alpha channel (or else the transparency) as
its alpha, 24 none. Without it: 32 with an alpha channel or transparency, else 24.
--dpx-bits sets a DPX's bits per sample. Without it: 8 for an 8-bit document, else 16.
--dds-compression sets a DDS texture's compression: none (uncompressed, the default), bc1
(DXT1: alpha on or off), bc2 (DXT3) or bc3 (DXT5). --dds-mipmaps also writes the full mip chain.
+ --jpeg-format picks a JPEG's scans, as JPEG Options does: baseline (the default), optimized
+ (Huffman tables fitted to the image; RGB is written 4:2:0 and keeps the standard tables, so
+ only Gray and CMYK shrink) or progressive.
photocraft-cli info <file> [--compact]
Print the document as JSON (size, mode, depth, layer tree).
- photocraft-cli run (<file> | --new <json>) --cmd <id> [--params <json>] [--cmd …] [--out <file>] [--format <ext>] [--quality <1-100>] [--tiff-layers] [--tiff-compression <none|lzw|zip>] [--tga-bits <24|32>] [--dpx-bits <8|10|12|16>] [--dds-compression <none|bc1|bc2|bc3>] [--dds-mipmaps]
- photocraft-cli run (<file> | --new <json>) --cmd <id> [--params <json>] [--cmd …] [--out <file>] [--format <ext>] [--quality <1-100>] [--tiff-layers] [--tga-bits <24|32>] [--dpx-bits <8|10|12|16>] [--dds-compression <none|bc1|bc2|bc3>] [--dds-mipmaps] [--jpeg-format <baseline|optimized|progressive>]
++ photocraft-cli run (<file> | --new <json>) --cmd <id> [--params <json>] [--cmd …] [--out <file>] [--format <ext>] [--quality <1-100>] [--tiff-layers] [--tiff-compression <none|lzw|zip>] [--tga-bits <24|32>] [--dpx-bits <8|10|12|16>] [--dds-compression <none|bc1|bc2|bc3>] [--dds-mipmaps] [--jpeg-format <baseline|optimized|progressive>]
Open a file, run engine commands in order, save the result. Each --params
applies to the preceding --cmd. Prints each command's JSON result.
- photocraft-cli batch --actions <actions.json|set.atn> [--action <name>] --in <dir> --out <dir> [--format <ext>] [--quality <1-100>] [--in-place] [--tiff-layers] [--tiff-compression <none|lzw|zip>] [--tga-bits <24|32>] [--dpx-bits <8|10|12|16>] [--dds-compression <none|bc1|bc2|bc3>] [--dds-mipmaps]
- photocraft-cli batch --actions <actions.json|set.atn> [--action <name>] --in <dir> --out <dir> [--format <ext>] [--quality <1-100>] [--in-place] [--tiff-layers] [--tga-bits <24|32>] [--dpx-bits <8|10|12|16>] [--dds-compression <none|bc1|bc2|bc3>] [--dds-mipmaps] [--jpeg-format <baseline|optimized|progressive>]
++ photocraft-cli batch --actions <actions.json|set.atn> [--action <name>] --in <dir> --out <dir> [--format <ext>] [--quality <1-100>] [--in-place] [--tiff-layers] [--tiff-compression <none|lzw|zip>] [--tga-bits <24|32>] [--dpx-bits <8|10|12|16>] [--dds-compression <none|bc1|bc2|bc3>] [--dds-mipmaps] [--jpeg-format <baseline|optimized|progressive>]
Apply an action list to every image in a directory. A Photoshop Actions file (.atn) is a
set: its action --action names plays, as below. JSON steps are [id, params] pairs,
{\"command\": id, \"params\": {…}} objects or bare ids, as a recorded action or droplet stores them
@@@ -74,20 -76,20 +77,20 @@@ struct Subcommand
const SUBCOMMANDS: &[Subcommand] = &[
Subcommand {
name: "convert",
- values: &["--format", "--quality", "--tga-bits", "--dpx-bits", "--dds-compression", "--tiff-compression"],
- values: &["--format", "--quality", "--tga-bits", "--dpx-bits", "--dds-compression", "--jpeg-format"],
++ values: &["--format", "--quality", "--tga-bits", "--dpx-bits", "--dds-compression", "--tiff-compression", "--jpeg-format"],
bare: &["--tiff-layers", "--dds-mipmaps"],
run: convert,
},
Subcommand { name: "info", values: &[], bare: &["--compact"], run: |a, out, _| info(a, out) },
Subcommand {
name: "run",
- values: &["--new", "--cmd", "--params", "--out", "--format", "--quality", "--tga-bits", "--dpx-bits", "--dds-compression", "--tiff-compression"],
- values: &["--new", "--cmd", "--params", "--out", "--format", "--quality", "--tga-bits", "--dpx-bits", "--dds-compression", "--jpeg-format"],
++ values: &["--new", "--cmd", "--params", "--out", "--format", "--quality", "--tga-bits", "--dpx-bits", "--dds-compression", "--tiff-compression", "--jpeg-format"],
bare: &["--tiff-layers", "--dds-mipmaps"],
run: run_cmds,
},
Subcommand {
name: "batch",
- values: &["--actions", "--action", "--in", "--out", "--format", "--quality", "--tga-bits", "--dpx-bits", "--dds-compression", "--tiff-compression"],
- values: &["--actions", "--action", "--in", "--out", "--format", "--quality", "--tga-bits", "--dpx-bits", "--dds-compression", "--jpeg-format"],
++ values: &["--actions", "--action", "--in", "--out", "--format", "--quality", "--tga-bits", "--dpx-bits", "--dds-compression", "--tiff-compression", "--jpeg-format"],
bare: &["--in-place", "--tiff-layers", "--dds-mipmaps"],
run: batch,
},
@@@ -227,14 -229,10 +230,18 @@@ fn export_opts(a: &Args) -> Result<Expo
o.encode.dpx_bits =
Some(b.parse().ok().and_then(photocraft_io::DpxBits::from_bits).ok_or_else(|| format!("bad --dpx-bits `{b}`: expected 8, 10, 12 or 16"))?);
}
+ if let Some(c) = a.get("--tiff-compression") {
+ o.encode.tiff_compression = match c {
+ "none" => photocraft_codecs::TiffCompression::None,
+ "lzw" => photocraft_codecs::TiffCompression::Lzw,
+ "zip" => photocraft_codecs::TiffCompression::Deflate,
+ _ => return Err(format!("bad --tiff-compression `{c}`: expected none, lzw or zip")),
+ };
+ }
+ if let Some(f) = a.get("--jpeg-format") {
+ o.encode.jpeg_format =
+ photocraft_codecs::JpegFormat::parse(f).ok_or_else(|| format!("bad --jpeg-format `{f}`: expected baseline, optimized or progressive"))?;
+ }
if let Some(c) = a.get("--dds-compression") {
o.encode.dds.compression =
photocraft_io::DdsCompression::from_name(c).ok_or_else(|| format!("bad --dds-compression `{c}`: expected none, bc1, bc2 or bc3"))?;
diff --cc crates/engine/src/atn_cmds.rs
index bf9d4247e,dd883708c..bdfd7411a
--- a/crates/engine/src/atn_cmds.rs
+++ b/crates/engine/src/atn_cmds.rs
@@@ -973,17 -982,46 +982,57 @@@ fn preserves_roundness(p: &Value) -> bo
p.get("preserve").and_then(Value::as_str) == Some("roundness")
}
+/// Whether any of the boolean `flags` is on in `p` (present, not null and not `false`).
+fn flag_set(p: &Value, flags: &[&str]) -> bool {
+ flags.iter().any(|f| p.get(*f).is_some_and(|v| !v.is_null() && *v != Value::Bool(false)))
+}
+
+/// Select > Modify with "Apply effect at canvas bounds": the descriptor has no field for it, so such a
+/// step is not exported (it would replay without the option).
+fn applies_at_canvas_bounds(p: &Value) -> bool {
+ flag_set(p, &["applyAtCanvasBounds"])
+}
+
+ /// Settings a mapped event has no field for, by command: `(param, the value the event plays as)`.
+ /// Photoshop's event has nowhere to put these, so a step that sets one cannot be written: it
+ /// would import as a different edit, silently. Such a step is refused, the way [`pixel_target`]
+ /// refuses a filter aimed at a mask -- and no key Photoshop does not define is invented for it,
+ /// which the clean-room rule forbids and which would make the file wrong in another reader.
+ ///
+ /// A step that leaves the setting at the value the event plays as exports as before.
+ /// How a setting the event cannot carry behaves once the step is replayed without it. Which of
+ /// the two a setting takes follows the command's own reading of it, not the parameter spec.
+ enum Lost {
+ /// Replay uses this value, so only a step already at it survives. Numbers and strings are
+ /// both compared as written, since the commands below read these settings as written.
+ ReplaysAs(&'static str),
+ /// The command reads only this one spelling as anything other than what replay does, so every
+ /// other value survives -- a differently cased one included, because it too plays as replay's.
+ DiffersAt(&'static str),
+ }
+
+ const UNHOLDABLE: &[(&str, &[(&str, Lost)])] = &[
+ // Crst carries ClSz only; replay seeds the pattern from 0 (#7668).
+ ("filter.pixelate.crystallize", &[("seed", Lost::ReplaysAs("0"))]),
+ // RdlB carries Amnt, BlrM and BlrQ; replay spins or zooms about the middle of the layer.
+ ("filter.blur.radialBlur", &[("centerX", Lost::ReplaysAs("0.5")), ("centerY", Lost::ReplaysAs("0.5"))]),
+ // Mnm /Mxm carry Rds only; replay keeps squareness, and so does the command for anything but
+ // the exact string "roundness" -- see `preserve` in filters.rs.
+ ("filter.other.minimum", &[("preserve", Lost::DiffersAt("roundness"))]),
+ ("filter.other.maximum", &[("preserve", Lost::DiffersAt("roundness"))]),
+ ];
+
+ /// Whether every setting of `p` that its event cannot hold would play the same without it
+ /// (see [`UNHOLDABLE`]).
+ fn holds_its_settings(id: &str, p: &Value) -> bool {
+ let Some((_, settings)) = UNHOLDABLE.iter().find(|(cmd, _)| *cmd == id) else { return true };
+ settings.iter().all(|(param, lost)| match (p.get(param), lost) {
+ (None | Some(Value::Null), _) => true,
+ (Some(v), Lost::ReplaysAs(played)) => v.as_str() == Some(played) || v.as_f64().is_some_and(|n| played.parse::<f64>().is_ok_and(|d| n == d)),
+ (Some(v), Lost::DiffersAt(spelling)) => v.as_str() != Some(spelling),
+ })
+ }
+
/// Whether `p` edits the layer's pixels: no `"target"` or `"target":"pixels"`. Photoshop's
/// descriptor for a plain event has no field for a mask, Quick Mask or channel target, so such
/// a step can't be exported faithfully.
@@@ -1854,10 -1893,7 +1940,10 @@@ fn transform_to(id: &str, p: &Value) -
return None;
}
let target = match id {
+ // The `Trnf` descriptor has no field for a mask, Quick Mask or alpha channel target; a
+ // layer reference would transform the layer's pixels instead.
+ "edit.transform" if !pixel_target(p) => return None,
- "edit.transform" => layer_ref(p),
+ "edit.transform" => layer_ref(p)?,
"select.transformSelection" => D::Reference(vec![ReferenceItem::Property { class: class("Chnl"), key: code("fsel") }]),
_ => return None,
};
diff --cc crates/engine/src/atn_cmds/tests.rs
index 7d864b4cb,34b4dc0ec..bd08c8bb4
--- a/crates/engine/src/atn_cmds/tests.rs
+++ b/crates/engine/src/atn_cmds/tests.rs
@@@ -1728,63 -1627,77 +1775,134 @@@ fn minimum_and_maximum_with_roundness_a
}
}
+/// #7515: a Transform Selection's interpolation survives the round trip as a layer transform's
+/// does. #7516-#7519: a reference point other than the centre, a skew or a warp can't be written,
+/// so the step is refused instead of replaying as a plain scale.
+#[test]
+fn transform_selection_keeps_its_interpolation_and_refuses_what_it_cannot_carry() {
+ let one = |id: &str, p: Value| Action { name: "Probe".into(), steps: vec![(id.into(), p)], ..Default::default() };
+ let p = json!({"dx": 0.7, "dy": 0, "scaleX": 140, "scaleY": 80, "interpolation": "nearest"});
+ let (bytes, skipped) = export("Audit7", &[&one("select.transformSelection", p.clone())], &[], false).unwrap();
+ assert!(skipped.is_empty());
+ let imported = import(&bytes).unwrap();
+ assert_eq!(imported.actions[0].steps, vec![("select.transformSelection".to_string(), p)]);
+ for id in ["select.transformSelection", "edit.transform"] {
+ for p in [
+ json!({"scaleX": 140, "reference": "topLeft"}),
+ json!({"scaleX": 140, "reference": [3, 4]}),
+ json!({"scaleX": 140, "skewX": 12}),
+ json!({"scaleX": 140, "skewY": -5}),
+ json!({"warp": "arc"}),
+ json!({"corners": [[0, 0], [10, 0], [10, 10], [0, 10]]}),
+ ] {
+ let err = export("Audit7", &[&one(id, p.clone())], &[], false).unwrap_err();
+ assert!(err.contains("no Photoshop equivalent") && err.contains(&format!("`{id}`")), "{id} {p}: {err}");
+ let (_, skipped) = export("Audit7", &[&one(id, p.clone())], &[], true).unwrap();
+ assert_eq!(skipped, vec![Skipped { action: "Probe".into(), step: 0, id: id.into() }], "{id} {p}");
+ }
+ let carried = json!({"scaleX": 140, "reference": "center", "skewX": 0, "skewY": 0});
+ assert!(export("Audit7", &[&one(id, carried.clone())], &[], false).is_ok(), "{id} {carried}");
+ }
+}
+
+/// #7540-#7542: Feather, Contract and Smooth (and Expand) with Apply Effect at Canvas Bounds, and
+/// #7543-#7546: a pattern Paint Bucket with a chosen pattern, scale, angle or phase, can't be
+/// written, so strict export refuses them. Their defaults still export and round-trip.
+#[test]
+fn canvas_bound_modify_and_placed_pattern_bucket_refuse_strict_export() {
+ let one = |id: &str, p: Value| Action { name: "Probe".into(), steps: vec![(id.into(), p)], ..Default::default() };
+ for id in ["select.modify.feather", "select.modify.expand", "select.modify.contract", "select.modify.smooth"] {
+ assert!(export("Audit7", &[&one(id, json!({"radius": 2, "applyAtCanvasBounds": true}))], &[], false).is_err(), "{id}");
+ let plain = json!({"radius": 2, "applyAtCanvasBounds": false});
+ let (bytes, _) = export("Audit7", &[&one(id, plain)], &[], false).unwrap_or_else(|e| panic!("{id}: {e}"));
+ assert_eq!(import(&bytes).unwrap().actions[0].steps, vec![(id.to_string(), json!({"radius": 2}))]);
+ }
+ let bucket = |extra: Value| {
+ let mut p = json!({"x": 5, "y": 5, "contents": "pattern", "opacity": 70, "tolerance": 80});
+ if let (Some(p), Some(e)) = (p.as_object_mut(), extra.as_object()) {
+ p.extend(e.clone());
+ }
+ one("paint.bucket", p)
+ };
+ for extra in [json!({"pattern": "AuditPattern"}), json!({"scale": 50}), json!({"angle": 30}), json!({"phase": [3, 5]})] {
+ assert!(export("Audit7", &[&bucket(extra.clone())], &[], false).is_err(), "{extra}");
+ }
+ for extra in [json!({}), json!({"scale": 100, "angle": 0, "phase": [0, 0]})] {
+ assert!(export("Audit7", &[&bucket(extra.clone())], &[], false).is_ok(), "{extra}");
+ }
+}
+
+ /// #7502, #7512, #7513, #7514: a New Layer step that clips to the layer below, has a colour
+ /// label, fills with the neutral colour or goes below the active layer isn't exported, since the
+ /// descriptor carries only its name, opacity and mode. Those options at their defaults still
+ /// export, and the step round-trips.
+ #[test]
+ fn new_layer_options_the_descriptor_cannot_carry_refuse_strict_export() {
+ let new_layer = |p: Value| Action { name: "Probe".into(), steps: vec![("layer.new.layer".into(), p)], ..Default::default() };
+ for p in [
+ json!({"name": "New", "clipToPrevious": true}),
+ json!({"name": "New", "color": "red"}),
+ json!({"name": "New", "mode": "Overlay", "fillNeutral": true}),
+ json!({"name": "New", "position": "below"}),
+ json!({"name": "New", "clipToPrevious": 1}),
+ ] {
+ assert!(export("Audit7", &[&new_layer(p.clone())], &[], false).is_err(), "{p}");
+ let (_, skipped) = export("Audit7", &[&new_layer(p.clone())], &[], true).unwrap();
+ assert_eq!(skipped, vec![Skipped { action: "Probe".into(), step: 0, id: "layer.new.layer".into() }], "{p}");
+ }
+ let defaults =
+ json!({"name": "New", "mode": "Multiply", "opacity": 0.6, "clipToPrevious": false, "color": "none", "fillNeutral": false, "position": "above"});
+ let (bytes, skipped) = export("Audit7", &[&new_layer(defaults)], &[], false).unwrap();
+ assert!(skipped.is_empty());
+ let imported = import(&bytes).unwrap();
+ assert_eq!(imported.actions[0].steps, vec![("layer.new.layer".to_string(), json!({"name": "New", "mode": "Multiply", "opacity": 0.6}))]);
+ }
+
+ /// Options the exported descriptors can't carry refuse strict export (and a partial export skips
+ /// the step) instead of exporting a step that replays differently; the forms they can carry still
+ /// export (#7196, #7246, #7287, #7503, #7506, #7507).
+ #[test]
+ fn options_the_descriptors_cannot_carry_refuse_strict_export() {
+ let one = |id: &str, p: Value| Action { name: "Probe".into(), steps: vec![(id.into(), p)], ..Default::default() };
+ let refused = [
+ ("layer.newFillLayer.solidColor", json!({"color": "#c0603080"})),
+ ("layer.newFillLayer.solidColor", json!({"color": "teal"})),
+ ("file.new", json!({"width": 24, "height": 18, "background": "black"})),
+ ("file.new", json!({"width": 24, "height": 18, "background": "#ab2233"})),
+ ("file.new", json!({"width": 24, "height": 18, "background": "backgroundColor", "backgroundColor": [0.2, 0.4, 0.6]})),
+ ("select.loadSelection", json!({"channel": "Alpha 1", "invert": true})),
+ ("select.loadSelection", json!({"channel": "Alpha 1", "operation": "subtract"})),
+ ("layer.setProps", json!({"opacity": 0.5, "locked": true})),
+ ("layer.setProps", json!({"opacity": 0.5, "clipped": true})),
+ ("layer.setProps", json!({"layers": [2, 3], "opacity": 0.5})),
+ ("filter.noise.addNoise", json!({"amount": 30, "seed": 2147483648_u64})),
+ ("filter.noise.addNoise", json!({"amount": 30, "seed": 4294967295_u64})),
+ ];
+ for (id, p) in refused {
+ let err = export("Audit7", &[&one(id, p.clone())], &[], false).unwrap_err();
+ assert!(err.contains(&format!("`{id}`")), "{id} {p}: the error names the step: {err}");
+ let (_, skipped) = export("Audit7", &[&one(id, p.clone())], &[], true).unwrap();
+ assert_eq!(skipped, vec![Skipped { action: "Probe".into(), step: 0, id: id.into() }], "{id} {p}");
+ }
+ let carried = [
+ ("layer.groupLayers", json!({"name": "Group"})),
+ ("layer.newFillLayer.solidColor", json!({"color": "#c06030"})),
+ ("file.new", json!({"width": 24, "height": 18, "background": "white"})),
+ ("file.new", json!({"width": 24, "height": 18, "background": "transparent"})),
+ ("file.new", json!({"width": 24, "height": 18, "background": "backgroundColor"})),
+ ("select.loadSelection", json!({"channel": "Alpha 1", "invert": false, "operation": "new"})),
+ // A named target (a numeric one is #7248, #7262).
+ ("layer.setProps", json!({"layer": "Pixels", "opacity": 0.5, "visible": true})),
+ ("filter.noise.addNoise", json!({"amount": 30, "seed": 2147483647})),
+ ];
+ for (id, p) in carried {
+ let (bytes, skipped) = export("Audit7", &[&one(id, p.clone())], &[], false).unwrap_or_else(|e| panic!("{id} {p}: {e}"));
+ assert!(skipped.is_empty(), "{id} {p}");
+ let imported = import(&bytes).unwrap();
+ assert_eq!(imported.actions[0].steps.first().map(|(i, _)| i.as_str()), Some(id), "{p}");
+ }
+ }
+
/// Photoshop's Close has no document target: a Close of a specific document must not be
/// exported as a plain Close, which would close the active document on playback.
#[test]
@@@ -1976,137 -1991,80 +2196,215 @@@ fn adjustment_layer_reset_still_resets(
assert_eq!(steps[1].1, json!({"midtones": [10, 0, 0], "kind": "colorBalance"}));
}
+/// A Free Transform recorded against an unlinked mask or an alpha channel must not export as a
+/// layer transform that moves the layer's pixels on replay (#7195).
+#[test]
+fn transform_with_mask_or_channel_target_is_not_exported_as_layer_transform() {
+ for target in [json!("mask"), json!({"channel": 0}), json!("quickMask")] {
+ let a = Action {
+ name: "Probe".into(),
+ steps: vec![("edit.transform".into(), json!({"target": target, "dx": 3, "dy": 2, "scaleX": 100, "interpolation": "nearest"}))],
+ ..Default::default()
+ };
+ assert!(export("Targets", &[&a], &[], false).is_err(), "{target} exported");
+ let (_, skipped) = export("Targets", &[&a], &[], true).unwrap();
+ assert_eq!(skipped, vec![Skipped { action: "Probe".into(), step: 0, id: "edit.transform".into() }]);
+ }
+ for params in [
+ json!({"dx": 3, "dy": 2, "scaleX": 50, "interpolation": "nearest"}),
+ json!({"target": "pixels", "dx": 3, "dy": 2, "scaleX": 50, "interpolation": "nearest"}),
+ ] {
+ let plain = Action { name: "Plain".into(), steps: vec![("edit.transform".into(), params)], ..Default::default() };
+ let (bytes, skipped) = export("Targets", &[&plain], &[], false).unwrap();
+ assert!(skipped.is_empty());
+ let imported = import(&bytes).unwrap();
+ assert_eq!(imported.actions[0].steps, vec![("edit.transform".to_string(), json!({"dx": 3, "dy": 2, "scaleX": 50, "interpolation": "nearest"}))]);
+ }
+ for form in [json!({"quad": [[0, 0], [1, 0], [1, 1], [0, 1]]}), json!({"matrix": [1, 0, 0, 1, 0, 0]}), json!({"rect": [0, 0, 1, 1]})] {
+ assert!(transform_to("edit.transform", &form).is_none());
+ }
+}
+
+/// Apply Image's optional blending mask has no `.atn` mapping: a strict export must refuse the
+/// step rather than drop the mask and widen the edit to the whole layer.
+#[test]
+fn apply_image_with_blending_mask_is_not_exported_without_its_mask() {
+ let source = json!({"layer": "Pixels", "channel": "green", "invert": true});
+ for params in [json!({"source": source, "blending": "normal", "mask": {"channel": 0}}), json!({"source": source, "blending": "normal", "maskChannel": 0})] {
+ let masked = Action { name: "Masked".into(), steps: vec![("image.applyImage".into(), params.clone())], ..Default::default() };
+ assert!(export("Audit5", &[&masked], &[], false).is_err(), "{params}");
+ let (_, skipped) = export("Audit5", &[&masked], &[], true).unwrap();
+ assert_eq!(skipped, vec![Skipped { action: "Masked".into(), step: 0, id: "image.applyImage".into() }]);
+ }
+ for params in [json!({"source": source, "blending": "normal"}), json!({"source": source, "blending": "normal", "mask": {"channel": "none"}})] {
+ let plain = Action { name: "Plain".into(), steps: vec![("image.applyImage".into(), params.clone())], ..Default::default() };
+ let (bytes, skipped) = export("Audit5", &[&plain], &[], false).unwrap();
+ assert!(skipped.is_empty());
+ let imported = import(&bytes).unwrap();
+ assert_eq!(imported.actions[0].steps, vec![("image.applyImage".to_string(), json!({"source": source, "blending": "normal"}))]);
+ }
+}
+
+fn image_size_round_trip(params: &Value) -> Option<Value> {
+ let item = export_item("image.imageSize", params, "S")?;
+ let e = event_for(&item.event).unwrap();
+ match (e.from)(item.descriptor.as_ref().unwrap()) {
+ Mapped::Steps(steps) => Some(steps[0].1.clone()),
+ _ => panic!("image size descriptor did not import as steps"),
+ }
+}
+
+ /// Photoshop's Select and Mask descriptor as mapped has no field for the Refine Edge Brush,
+ /// so a step with brush strokes must not export as a plain Select and Mask without them.
+ #[test]
+ fn refine_edge_with_brush_strokes_is_not_exported_without_them() {
+ for mode in ["add", "subtract"] {
+ let brushed = Action {
+ name: "Probe".into(),
+ steps: vec![("select.refineEdge".into(), json!({"radius": 1, "refineStrokes": [{"points": [[5, 4]], "size": 4, "mode": mode}]}))],
+ ..Default::default()
+ };
+ assert!(export("Audit", &[&brushed], &[], false).is_err(), "{mode}");
+ let (_, skipped) = export("Audit", &[&brushed], &[], true).unwrap();
+ assert_eq!(skipped, vec![Skipped { action: "Probe".into(), step: 0, id: "select.refineEdge".into() }]);
+ }
+ for params in [json!({"radius": 1}), json!({"radius": 1, "refineStrokes": []}), json!({"radius": 1, "refineStrokes": null})] {
+ let plain = Action { name: "Plain".into(), steps: vec![("select.refineEdge".into(), params)], ..Default::default() };
+ let (bytes, skipped) = export("Audit", &[&plain], &[], false).unwrap();
+ assert!(skipped.is_empty());
+ let imported = import(&bytes).unwrap();
+ assert_eq!(imported.actions[0].steps, vec![("select.refineEdge".to_string(), json!({"radius": 1}))]);
+ }
+ }
+
+#[test]
+fn image_size_resolution_only_does_not_gain_keep_print_size() {
+ // The .atn cannot tell resolution-only from keepPrintSize:true, so the former must not
+ // export as a descriptor that imports back as keep-print-size.
+ let params = json!({"resolution": 144, "resample": "nearest"});
+ assert_eq!(image_size_round_trip(&params), None);
+}
+
+#[test]
+fn image_size_intentional_controls_still_round_trip() {
+ for params in [
+ json!({"resolution": 144.0, "resample": "nearest", "keepPrintSize": true}),
+ json!({"width": 12.0, "height": 10.0, "resolution": 144.0, "resample": "nearest"}),
+ ] {
+ assert_eq!(image_size_round_trip(&params), Some(params.clone()));
+ }
+}
+
+#[test]
+fn recorded_layer_select_exports_to_atn() {
+ let mut s = Session::new();
+ s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
+ let l = s.execute("layer.new.layer", json!({"name": "Wanted"})).unwrap();
+ let wanted_id = l["layer"].as_u64().unwrap();
+ s.execute("actions.record", json!({"name": "SelectWanted"})).unwrap();
+ s.execute("layer.select", json!({"layer": wanted_id})).unwrap();
+ s.execute("actions.stop", json!({})).unwrap();
+
+ let action = s.execute("actions.get", json!({"action": "SelectWanted"})).unwrap();
+ assert_eq!(action["steps"][0], json!(["layer.select", {"name": "Wanted"}]));
+
+ // Strict export should succeed and produce bytes without skipUnsupported
+ let saved = s.execute("actions.save", json!({"action": "SelectWanted"})).unwrap();
+ assert_eq!(saved["steps"], 1);
+ assert_eq!(saved["skipped"], json!([]));
+
+ // When exported with skipUnsupported: true, it shouldn't skip the step either
+ let saved_skip = s.execute("actions.save", json!({"action": "SelectWanted", "skipUnsupported": true})).unwrap();
+ assert_eq!(saved_skip["steps"], 1);
+ assert_eq!(saved_skip["skipped"], json!([]));
+
+ // If an action has an occurrence target (duplicate names), it cannot be represented unambiguously in .atn
+ let bad_action = Action::new("Dup", vec![("layer.select".into(), json!({"name": "Wanted", "occurrence": 1}))]);
+ let err = export("Set", &[&bad_action], &[], false);
+ assert!(err.is_err(), "occurrence without representation must fail strict export");
+}
+
+#[test]
+fn select_rect_mode_strict_export_rejects_unrepresentable_modes() {
+ let mut s = Session::new();
+ s.execute("file.new", json!({"width": 8, "height": 8})).unwrap();
+
+ // Default or "replace" mode succeeds
+ s.actions.list.push(Action::new("ReplaceAct", vec![("select.rect".into(), json!({"x": 4, "y": 4, "width": 2, "height": 2, "mode": "replace"}))]));
+ let saved = s.execute("actions.save", json!({"action": "ReplaceAct"})).unwrap();
+ assert_eq!(saved["steps"], 1);
+
+ // "add" mode cannot be silently converted to replace (set) in strict export
+ s.actions.list.push(Action::new("AddAct", vec![("select.rect".into(), json!({"x": 4, "y": 4, "width": 2, "height": 2, "mode": "add"}))]));
+ let before_actions = s.actions.list.clone();
+ let err = s.execute("actions.save", json!({"action": "AddAct"}));
+ assert!(err.is_err(), "strict export must reject select.rect with add mode rather than converting to replace");
+ assert_eq!(s.actions.list, before_actions, "actions list must remain unchanged after rejected save");
+
+ // "subtract" mode cannot be silently converted to replace either
+ s.actions.list.push(Action::new("SubtractAct", vec![("select.rect".into(), json!({"x": 4, "y": 4, "width": 2, "height": 2, "mode": "subtract"}))]));
+ let before_actions_sub = s.actions.list.clone();
+ let err_subtract = s.execute("actions.save", json!({"action": "SubtractAct"}));
+ assert!(err_subtract.is_err(), "strict export must reject select.rect with subtract mode rather than converting to replace");
+ assert_eq!(s.actions.list, before_actions_sub, "actions list must remain unchanged after rejected save");
+
+ // With skipUnsupported: true, unrepresentable modes are reported in skipped
+ let skipped = s.execute("actions.save", json!({"action": "AddAct", "skipUnsupported": true})).unwrap();
+ assert_eq!(skipped["steps"], 0);
+ assert_eq!(skipped["skipped"][0]["id"], "select.rect");
+}
++
+ #[test]
+ fn radial_blur_off_center_strict_export_refuses_silent_recentering() {
+ let mut s = Session::new();
+ s.execute("file.new", json!({"width": 16, "height": 16})).unwrap();
+
+ // Default center (omitted) exports successfully
+ s.actions.list.push(Action::new("DefaultCenter", vec![("filter.blur.radialBlur".into(), json!({"amount": 50, "method": "spin", "quality": "good"}))]));
+ let saved = s.execute("actions.save", json!({"action": "DefaultCenter"})).unwrap();
+ assert_eq!(saved["steps"], 1);
+
+ // Explicit (0.5, 0.5) center also exports successfully
+ s.actions.list.push(Action::new(
+ "ExplicitDefaultCenter",
+ vec![("filter.blur.radialBlur".into(), json!({"amount": 50, "method": "spin", "quality": "good", "centerX": 0.5, "centerY": 0.5}))],
+ ));
+ let saved_exp = s.execute("actions.save", json!({"action": "ExplicitDefaultCenter"})).unwrap();
+ assert_eq!(saved_exp["steps"], 1);
+
+ // Off-center radial blur cannot be silently recentered in strict export
+ s.actions.list.push(Action::new(
+ "OffCenter",
+ vec![("filter.blur.radialBlur".into(), json!({"amount": 50, "method": "spin", "quality": "good", "centerX": 0.1, "centerY": 0.2}))],
+ ));
+ let before_actions = s.actions.list.clone();
+ let err = s.execute("actions.save", json!({"action": "OffCenter"}));
+ assert!(err.is_err(), "strict export must reject off-center radial blur rather than silently recentering it");
+ assert_eq!(s.actions.list, before_actions, "actions list must remain unchanged after rejected save");
+
+ // With skipUnsupported: true, off-center radial blur is skipped
+ let skipped = s.execute("actions.save", json!({"action": "OffCenter", "skipUnsupported": true})).unwrap();
+ assert_eq!(skipped["steps"], 0);
+ assert_eq!(skipped["skipped"][0]["id"], "filter.blur.radialBlur");
+
+ // Radial blur targeting a mask must not export as a plain filter that edits pixels
+ s.actions
+ .list
+ .push(Action::new("MaskTarget", vec![("filter.blur.radialBlur".into(), json!({"amount": 50, "method": "spin", "quality": "good", "target": "mask"}))]));
+ let before_actions = s.actions.list.clone();
+ let err_mask = s.execute("actions.save", json!({"action": "MaskTarget"}));
+ assert!(err_mask.is_err(), "strict export must reject radial blur with non-pixel target");
+ assert_eq!(s.actions.list, before_actions, "actions list must remain unchanged after rejected save");
+
+ let skipped_mask = s.execute("actions.save", json!({"action": "MaskTarget", "skipUnsupported": true})).unwrap();
+ assert_eq!(skipped_mask["steps"], 0);
+ assert_eq!(skipped_mask["skipped"][0]["id"], "filter.blur.radialBlur");
+
+ // Explicit pixels target exports successfully
+ s.actions.list.push(Action::new(
+ "PixelsTarget",
+ vec![("filter.blur.radialBlur".into(), json!({"amount": 50, "method": "spin", "quality": "good", "target": "pixels"}))],
+ ));
+ let saved_pixels = s.execute("actions.save", json!({"action": "PixelsTarget"})).unwrap();
+ assert_eq!(saved_pixels["steps"], 1);
+ }
diff --cc crates/engine/src/file_cmds.rs
index 199af8590,c68b3f97a..904c3e7dc
--- a/crates/engine/src/file_cmds.rs
+++ b/crates/engine/src/file_cmds.rs
@@@ -381,21 -382,25 +386,40 @@@ pub fn tga_bits_param(p: &Value, cmd: &
}
}
+/// The TIFF compression in `p` (`"tiffCompression": "none" | "lzw" | "zip"`, Photoshop's TIFF
+/// Options; absent or null: none). Anything else is a bad parameter of command `cmd` (#5301).
+pub fn tiff_compression_param(p: &Value, cmd: &str) -> Result<Option<photocraft_codecs::TiffCompression>> {
+ use photocraft_codecs::TiffCompression;
+ match p.get("tiffCompression") {
+ None | Some(Value::Null) => Ok(None),
+ Some(v) => match v.as_str() {
+ Some("none") => Ok(Some(TiffCompression::None)),
+ Some("lzw") => Ok(Some(TiffCompression::Lzw)),
+ Some("zip") => Ok(Some(TiffCompression::Deflate)),
+ _ => Err(EngineError::BadParams { cmd: cmd.into(), msg: format!("`tiffCompression` must be \"none\", \"lzw\" or \"zip\", got {v}") }),
+ },
+ }
+}
+
+ /// The JPEG format in `p` (`"jpegFormat": "baseline" | "optimized" | "progressive"`; absent or
+ /// null: Baseline). Anything else is a bad parameter of command `cmd`. Shared like
+ /// [`tga_bits_param`].
+ pub fn jpeg_format_param(p: &Value, cmd: &str) -> Result<Option<photocraft_codecs::JpegFormat>> {
+ match p.get("jpegFormat") {
+ None | Some(Value::Null) => Ok(None),
+ Some(v) => v.as_str().and_then(photocraft_codecs::JpegFormat::parse).map(Some).ok_or_else(|| EngineError::BadParams {
+ cmd: cmd.into(),
+ msg: format!("`jpegFormat` must be \"baseline\", \"optimized\" or \"progressive\", got {v}"),
+ }),
+ }
+ }
+
+ /// Photoshop's 0–12 JPEG quality as the encoder's 1–100 (0 → 1, 12 → 100, linear between; out of
+ /// range is clamped, and NaN or infinite is 100).
+ pub fn jpeg_quality(q: f64) -> u8 {
+ if q.is_finite() { (q.clamp(0.0, 12.0) / 12.0 * 99.0 + 1.0).round() as u8 } else { 100 }
+ }
+
/// The DPX bits per sample in `p` (`"dpxBits": 8 | 10 | 12 | 16`; absent or null: the document's
/// depth). Anything else is a bad parameter of command `cmd`.
pub fn dpx_bits_param(p: &Value, cmd: &str) -> Result<Option<photocraft_io::DpxBits>> {
@@@ -450,12 -455,9 +474,12 @@@ pub(crate) fn encode(doc: &Document, pa
// lossy or lossless as it was), as Photoshop's Save does.
photocraft_io::apply_file_encoding(doc, &mut opts.encode);
opts.encode.dpx_bits = save.dpx_bits;
+ if let Some(c) = save.tiff_compression {
+ opts.encode.tiff_compression = c;
+ }
opts.encode.dds = save.dds;
if let Some(q) = save.quality {
- let q = (q.clamp(0.0, 12.0) / 12.0 * 99.0 + 1.0).round() as u8;
+ let q = jpeg_quality(q);
opts.encode.jpeg_quality = q;
// A quality on a WebP save asks for the lossy encoder; the default WebP stays lossless.
opts.encode.webp_quality = q;
@@@ -1756,7 -1750,7 +1783,7 @@@ pub fn specs() -> Vec<CommandSpec>
"Save a Copy…",
&["File"],
Some("Cmd+Alt+S"),
- r##"{"path":str (format from the extension),"quality":0..12? (JPEG),"layers":bool=true,"overwrite":bool=false (replace the document's own file),"tiffLayers":bool=false (TIFF: keep the layers; flat by default),"tiffCompression":"none|lzw|zip"? (TIFF: image compression; unset, none),"tgaBits":24|32? (TGA: 32 writes the alpha channel, or else the transparency, as the alpha; unset, 32 with an alpha channel or transparency, else 24),"dpxBits":8|10|12|16? (DPX: bits per sample; unset, 8 for an 8-bit document, else 16),"ddsCompression":"none|bc1|bc2|bc3"="none" (DDS: uncompressed, or block compression; BC1 keeps alpha on or off),"ddsMipmaps":bool=false (DDS: also write the full mip chain)}"##,
- r##"{"path":str (format from the extension),"quality":0..12? (JPEG),"jpegFormat":"baseline|optimized|progressive"? (JPEG; default baseline),"layers":bool=true,"overwrite":bool=false (replace the document's own file),"tiffLayers":bool=false (TIFF: keep the layers; flat by default),"tgaBits":24|32? (TGA: 32 writes the alpha channel, or else the transparency, as the alpha; unset, 32 with an alpha channel or transparency, else 24),"dpxBits":8|10|12|16? (DPX: bits per sample; unset, 8 for an 8-bit document, else 16),"ddsCompression":"none|bc1|bc2|bc3"="none" (DDS: uncompressed, or block compression; BC1 keeps alpha on or off),"ddsMipmaps":bool=false (DDS: also write the full mip chain)}"##,
++ r##"{"path":str (format from the extension),"quality":0..12? (JPEG),"jpegFormat":"baseline|optimized|progressive"? (JPEG; default baseline),"layers":bool=true,"overwrite":bool=false (replace the document's own file),"tiffLayers":bool=false (TIFF: keep the layers; flat by default),"tiffCompression":"none|lzw|zip"? (TIFF: image compression; unset, none),"tgaBits":24|32? (TGA: 32 writes the alpha channel, or else the transparency, as the alpha; unset, 32 with an alpha channel or transparency, else 24),"dpxBits":8|10|12|16? (DPX: bits per sample; unset, 8 for an 8-bit document, else 16),"ddsCompression":"none|bc1|bc2|bc3"="none" (DDS: uncompressed, or block compression; BC1 keeps alpha on or off),"ddsMipmaps":bool=false (DDS: also write the full mip chain)}"##,
native_doc,
save_a_copy
),
@@@ -1819,7 -1813,7 +1846,7 @@@
"Batch…",
&["File", "Automate"],
None,
- r##"{"steps":[[commandId,params]|{"command":id,"params":{}}…] (a recorded action),"input":folder|[paths],"includeSubfolders":bool=false (a folder input also takes the images in its subfolders, up to 32 levels and 100000 files; each result keeps its subfolder under output),"output":folder,"format":"same|png|jpg|psd|tiff|…"="same","quality":0..12?,"naming":string? (blank keeps source names; {name}, {serial} padded to 3 digits, {date} as YYYY-MM-DD UTC; extension added automatically),"startingSerial":1..4294967295=1 (input position, including failed inputs),"tiffLayers":bool=false,"tiffCompression":"none|lzw|zip"?,"tgaBits":24|32?,"dpxBits":8|10|12|16? (DPX: bits per sample; unset, 8 for an 8-bit document, else 16),"ddsCompression":"none|bc1|bc2|bc3"="none" (DDS: uncompressed, or block compression; BC1 keeps alpha on or off),"ddsMipmaps":bool=false (DDS: also write the full mip chain),"calledActions":[{"name","steps"}…]? (the actions Play Action steps call; default: the session's)} → {files, errors} (an input whose output name was already written in the run goes to errors)"##,
- r##"{"steps":[[commandId,params]|{"command":id,"params":{}}…] (a recorded action),"input":folder|[paths],"includeSubfolders":bool=false (a folder input also takes the images in its subfolders, up to 32 levels and 100000 files; each result keeps its subfolder under output),"output":folder,"format":"same|png|jpg|psd|tiff|…"="same","quality":0..12?,"jpegFormat":"baseline|optimized|progressive"?,"naming":string? (blank keeps source names; {name}, {serial} padded to 3 digits, {date} as YYYY-MM-DD UTC; extension added automatically),"startingSerial":1..4294967295=1 (input position, including failed inputs),"tiffLayers":bool=false,"tgaBits":24|32?,"dpxBits":8|10|12|16? (DPX: bits per sample; unset, 8 for an 8-bit document, else 16),"ddsCompression":"none|bc1|bc2|bc3"="none" (DDS: uncompressed, or block compression; BC1 keeps alpha on or off),"ddsMipmaps":bool=false (DDS: also write the full mip chain),"calledActions":[{"name","steps"}…]? (the actions Play Action steps call; default: the session's)} → {files, errors} (an input whose output name was already written in the run goes to errors)"##,
++ r##"{"steps":[[commandId,params]|{"command":id,"params":{}}…] (a recorded action),"input":folder|[paths],"includeSubfolders":bool=false (a folder input also takes the images in its subfolders, up to 32 levels and 100000 files; each result keeps its subfolder under output),"output":folder,"format":"same|png|jpg|psd|tiff|…"="same","quality":0..12?,"jpegFormat":"baseline|optimized|progressive"?,"naming":string? (blank keeps source names; {name}, {serial} padded to 3 digits, {date} as YYYY-MM-DD UTC; extension added automatically),"startingSerial":1..4294967295=1 (input position, including failed inputs),"tiffLayers":bool=false,"tiffCompression":"none|lzw|zip"?,"tgaBits":24|32?,"dpxBits":8|10|12|16? (DPX: bits per sample; unset, 8 for an 8-bit document, else 16),"ddsCompression":"none|bc1|bc2|bc3"="none" (DDS: uncompressed, or block compression; BC1 keeps alpha on or off),"ddsMipmaps":bool=false (DDS: also write the full mip chain),"calledActions":[{"name","steps"}…]? (the actions Play Action steps call; default: the session's)} → {files, errors} (an input whose output name was already written in the run goes to errors)"##,
native,
batch
),
@@@ -1828,7 -1822,7 +1855,7 @@@
"Image Processor…",
&["File", "Scripts"],
None,
- r##"{"input":folder|[paths],"includeSubfolders":bool=false (a folder input also takes the images in its subfolders, up to 32 levels and 100000 files; each result keeps its subfolder under output),"output":folder,"format":"jpg|png|psd|tiff|…"="jpg","quality":0..12=8,"tiffLayers":bool=false,"tiffCompression":"none|lzw|zip"?,"tgaBits":24|32?,"dpxBits":8|10|12|16? (DPX: bits per sample; unset, 8 for an 8-bit document, else 16),"ddsCompression":"none|bc1|bc2|bc3"="none" (DDS: uncompressed, or block compression; BC1 keeps alpha on or off),"ddsMipmaps":bool=false (DDS: also write the full mip chain),"width":px?,"height":px? (fit, never enlarge),"convertToSrgb":bool=false} → {files, errors} (an input whose output name was already written in the run goes to errors)"##,
- r##"{"input":folder|[paths],"includeSubfolders":bool=false (a folder input also takes the images in its subfolders, up to 32 levels and 100000 files; each result keeps its subfolder under output),"output":folder,"format":"jpg|png|psd|tiff|…"="jpg","quality":0..12=8,"jpegFormat":"baseline|optimized|progressive"?,"tiffLayers":bool=false,"tgaBits":24|32?,"dpxBits":8|10|12|16? (DPX: bits per sample; unset, 8 for an 8-bit document, else 16),"ddsCompression":"none|bc1|bc2|bc3"="none" (DDS: uncompressed, or block compression; BC1 keeps alpha on or off),"ddsMipmaps":bool=false (DDS: also write the full mip chain),"width":px?,"height":px? (fit, never enlarge),"convertToSrgb":bool=false} → {files, errors} (an input whose output name was already written in the run goes to errors)"##,
++ r##"{"input":folder|[paths],"includeSubfolders":bool=false (a folder input also takes the images in its subfolders, up to 32 levels and 100000 files; each result keeps its subfolder under output),"output":folder,"format":"jpg|png|psd|tiff|…"="jpg","quality":0..12=8,"jpegFormat":"baseline|optimized|progressive"?,"tiffLayers":bool=false,"tiffCompression":"none|lzw|zip"?,"tgaBits":24|32?,"dpxBits":8|10|12|16? (DPX: bits per sample; unset, 8 for an 8-bit document, else 16),"ddsCompression":"none|bc1|bc2|bc3"="none" (DDS: uncompressed, or block compression; BC1 keeps alpha on or off),"ddsMipmaps":bool=false (DDS: also write the full mip chain),"width":px?,"height":px? (fit, never enlarge),"convertToSrgb":bool=false} → {files, errors} (an input whose output name was already written in the run goes to errors)"##,
native,
image_processor
),
@@@ -1856,7 -1850,7 +1883,7 @@@
"Layers to Files…",
&["File", "Export"],
None,
- r##"{"dir":folder,"format":"png|jpg|psd|tiff|…"="png","prefix":str=document name,"visibleOnly":bool=true,"quality":0..12?,"tiffLayers":bool=false,"tiffCompression":"none|lzw|zip"?,"tgaBits":24|32?,"dpxBits":8|10|12|16? (DPX: bits per sample; unset, 8 for an 8-bit document, else 16),"ddsCompression":"none|bc1|bc2|bc3"="none" (DDS: uncompressed, or block compression; BC1 keeps alpha on or off),"ddsMipmaps":bool=false (DDS: also write the full mip chain)} → {files}"##,
- r##"{"dir":folder,"format":"png|jpg|psd|tiff|…"="png","prefix":str=document name,"visibleOnly":bool=true,"quality":0..12?,"jpegFormat":"baseline|optimized|progressive"?,"tiffLayers":bool=false,"tgaBits":24|32?,"dpxBits":8|10|12|16? (DPX: bits per sample; unset, 8 for an 8-bit document, else 16),"ddsCompression":"none|bc1|bc2|bc3"="none" (DDS: uncompressed, or block compression; BC1 keeps alpha on or off),"ddsMipmaps":bool=false (DDS: also write the full mip chain)} → {files}"##,
++ r##"{"dir":folder,"format":"png|jpg|psd|tiff|…"="png","prefix":str=document name,"visibleOnly":bool=true,"quality":0..12?,"jpegFormat":"baseline|optimized|progressive"?,"tiffLayers":bool=false,"tiffCompression":"none|lzw|zip"?,"tgaBits":24|32?,"dpxBits":8|10|12|16? (DPX: bits per sample; unset, 8 for an 8-bit document, else 16),"ddsCompression":"none|bc1|bc2|bc3"="none" (DDS: uncompressed, or block compression; BC1 keeps alpha on or off),"ddsMipmaps":bool=false (DDS: also write the full mip chain)} → {files}"##,
native_doc,
layers_to_files
),
diff --cc crates/ui-egui/src/file_dialog/tests.rs
index 224fdb96c,b3b44c731..9ed14dd93
--- a/crates/ui-egui/src/file_dialog/tests.rs
+++ b/crates/ui-egui/src/file_dialog/tests.rs
@@@ -1124,27 -1192,52 +1192,72 @@@ fn save_of_a_flat_file_asks_after_the_d
assert!(written.borrow().is_empty(), "the changed file is not replaced before the answer");
let id = disk_prompt(&app).expect("Save asks first").id;
crate::dialogs::confirm(&mut app, id).unwrap();
+ // Then JPEG Options (FILE-215-19), whose answer is still recorded as a plain Save.
+ assert!(written.borrow().is_empty());
+ assert_eq!(app.jpeg_options.as_ref().map(|p| p.record), Some("file.save"));
+ crate::jpeg_options_ui::confirm(&mut app, &ctx);
assert_eq!(*written.borrow(), [path]);
assert!(!app.session.active().unwrap().is_dirty());
- assert_eq!(app.session.journal.last().map(|s| s.0.as_str()), Some("file.save"), "still recorded as a plain Save");
+ assert_eq!(app.session.journal.last(), Some(&("file.save".to_string(), json!({}))), "still recorded as a plain Save");
+ }
+
+ /// A replayed plain Save keeps its Targa answer in the step it records, as well as its JPEG one.
+ #[test]
+ fn a_replayed_plain_save_records_its_targa_answer() {
+ let (mut app, _, written) = jpeg_app(Some("/pics/photo.tga"), false);
+ app.replay_save("file.save", &json!({"tgaBits": 24})).unwrap();
+ assert_eq!(*written.borrow(), ["/pics/photo.tga"]);
+ assert_eq!(app.session.journal.last(), Some(&("file.save".to_string(), json!({"tgaBits": 24}))));
+ }
+
+ /// A script's JPEG Options answer survives the changed-on-disk prompt: Replace writes with it,
+ /// without asking JPEG Options.
+ #[test]
+ fn a_scripted_quality_survives_the_changed_on_disk_prompt() {
+ let ctx = egui::Context::default();
+ let path = "/pics/My image.jpg";
+ let (mut app, open, written) = jpeg_app(None, false);
+ let qualities: Rc<RefCell<Vec<Option<u8>>>> = Rc::default();
+ let q = qualities.clone();
+ app.services.export = Some(Box::new(move |_: &photocraft_doc::Document, _: &str, s: &crate::ExportSettings| {
+ q.borrow_mut().push(s.jpeg_quality);
+ Ok((b"out".to_vec(), Vec::new()))
+ }));
+ let disk = on_disk(&mut app);
+ changed_by_another_app(&disk, path);
+ app.opened_from(path);
+ app.run("image.adjustments.invert", json!({})).unwrap();
+ changed_by_another_app(&disk, path);
+ menus::invoke(&mut app, &ctx, "file.save", json!({"quality": 5})).unwrap();
+ app.poll_file_dialog(&ctx, None);
+ answer(&open, Some(FileDialogAnswer::SaveTo(path.into())));
+ app.poll_file_dialog(&ctx, None);
+ assert!(written.borrow().is_empty(), "the changed file is not replaced before the answer");
+ let id = disk_prompt(&app).expect("Save asks first").id;
+ crate::dialogs::confirm(&mut app, id).unwrap();
+ assert!(app.jpeg_options.is_none(), "the script answered JPEG Options");
+ assert_eq!(*written.borrow(), [path]);
+ assert_eq!(qualities.borrow().last().copied().flatten(), Some(photocraft_engine::file_cmds::jpeg_quality(5.0)));
+ // Recorded as a plain Save keeping the answer, so a replay writes the file it's played on.
+ assert_eq!(app.session.journal.last(), Some(&("file.save".to_string(), json!({"quality": 5, "jpegFormat": "baseline"}))));
}
+
+/// File › Save a Copy suggests "<name> copy", and with Preferences › File Handling › Do not
+/// append "copy" to filename when saving a copy, the document's own name, as in Photoshop
+/// (#8080). The preference goes through `prefs.set` like the Preferences dialog's checkbox.
+#[test]
+fn save_a_copy_appends_copy_unless_the_preference_says_not_to() {
+ let ctx = egui::Context::default();
+ for (off, name) in [(false, "My image copy.psd"), (true, "My image.psd")] {
+ let want = std::path::Path::new("/pics").join(name).to_string_lossy().into_owned();
+ let (mut app, open, _) = jpeg_app(Some("/pics/My image.JPEG"), false);
+ app.run("prefs.set", json!({"path": "fileHandling.doNotAppendCopy", "value": off})).unwrap();
+ menus::invoke(&mut app, &ctx, "file.saveACopy", json!({})).unwrap();
+ app.poll_file_dialog(&ctx, None);
+ assert!(
+ matches!(open.borrow().as_slice(), [(FileDialogRequest::Save { suggested }, _)] if *suggested == want),
+ "{off}: {:?}",
+ open.borrow().first().map(|(r, _)| r.clone())
+ );
+ }
+}
diff --cc crates/ui-egui/src/i18n/cs.tsv
index ea4efa65b,359b17546..39b71029f
--- a/crates/ui-egui/src/i18n/cs.tsv
+++ b/crates/ui-egui/src/i18n/cs.tsv
@@@ -3912,10 -3934,4 +3936,11 @@@ navigator Zoom Zvětšen�
# Graphics Adapter preference (#1885)
GPU adapter Adaptér GPU
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Nejprve potvrďte nebo zrušte otevřený dialog kroku akce
+ Pro Medium Gray Pro (středně šedý)
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Pro (světle šedý)
+ Pro Light Pro (světlý)
+ Resize Windows to Fit Přizpůsobit velikost oken
diff --cc crates/ui-egui/src/i18n/de.tsv
index 3cb1cf534,0f91c6c9a..dff678c5a
--- a/crates/ui-egui/src/i18n/de.tsv
+++ b/crates/ui-egui/src/i18n/de.tsv
@@@ -3310,10 -3332,4 +3334,11 @@@ curves Smooth Glätte
# Graphics Adapter preference (#1885)
GPU adapter GPU-Adapter
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Bestätige oder brich zuerst den offenen Dialog des Aktionsschritts ab
+ Pro Medium Gray Pro (Mittelgrau)
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Pro (Hellgrau)
+ Pro Light Pro (Hell)
+ Resize Windows to Fit Fenstergröße anpassen
diff --cc crates/ui-egui/src/i18n/el.tsv
index 495604a15,1fb21b6c3..19bb10cbb
--- a/crates/ui-egui/src/i18n/el.tsv
+++ b/crates/ui-egui/src/i18n/el.tsv
@@@ -4001,10 -4023,4 +4025,11 @@@ curves Smooth Εξομάλυνσ�
# Graphics Adapter preference (#1885)
GPU adapter Προσαρμογέας GPU
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Επιβεβαιώστε ή ακυρώστε πρώτα το ανοιχτό παράθυρο βήματος της ενέργειας
+ Pro Medium Gray Pro μεσαίου γκρι
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Pro ανοιχτού γκρι
+ Pro Light Φωτεινό Pro
+ Resize Windows to Fit Προσαρμογή μεγέθους παραθύρων
diff --cc crates/ui-egui/src/i18n/es.tsv
index 82d1ba9e2,51dd5ff0a..3a995e708
--- a/crates/ui-egui/src/i18n/es.tsv
+++ b/crates/ui-egui/src/i18n/es.tsv
@@@ -4263,10 -4285,4 +4287,11 @@@ navigator Zoom Zoo
# Graphics Adapter preference (#1885)
GPU adapter Adaptador de GPU
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Confirme o cancele primero el cuadro de diálogo abierto del paso de la acción
+ Pro Medium Gray Pro (gris medio)
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Pro (gris claro)
+ Pro Light Pro (claro)
+ Resize Windows to Fit Redimensionar ventanas para ajustar
diff --cc crates/ui-egui/src/i18n/fr.tsv
index bd7f8009a,83c91cdbe..b818959f0
--- a/crates/ui-egui/src/i18n/fr.tsv
+++ b/crates/ui-egui/src/i18n/fr.tsv
@@@ -3312,10 -3334,4 +3336,11 @@@ curves Smooth Lisse
# Graphics Adapter preference (#1885)
GPU adapter Adaptateur GPU
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Validez ou annulez d’abord la boîte de dialogue ouverte de l’étape de l’action
+ Pro Medium Gray Pro gris moyen
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Pro gris clair
+ Pro Light Pro clair
+ Resize Windows to Fit Redimensionner les fenêtres
diff --cc crates/ui-egui/src/i18n/hu.tsv
index 2469151be,3b9022115..e828a341c
--- a/crates/ui-egui/src/i18n/hu.tsv
+++ b/crates/ui-egui/src/i18n/hu.tsv
@@@ -4218,10 -4240,4 +4242,11 @@@ cameraRaw Yellow Sárg
# Graphics Adapter preference (#1885)
GPU adapter GPU-adapter
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Előbb hagyd jóvá vagy vond vissza a művelet lépésének nyitott párbeszédablakát
+ Pro Medium Gray Pro középszürke
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Pro világosszürke
+ Pro Light Pro világos
+ Resize Windows to Fit Ablakok átméretezése a képhez
diff --cc crates/ui-egui/src/i18n/id.tsv
index a86ed7f26,5e4b15da2..10698aa6b
--- a/crates/ui-egui/src/i18n/id.tsv
+++ b/crates/ui-egui/src/i18n/id.tsv
@@@ -3315,10 -3321,4 +3339,11 @@@ curves Smooth Haluska
# Graphics Adapter preference (#1885)
GPU adapter Adaptor GPU
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Konfirmasi atau batalkan dulu dialog langkah tindakan yang terbuka
+ Pro Medium Gray Pro Abu-abu Sedang
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Pro Abu-abu Terang
+ Pro Light Pro Terang
+ Resize Windows to Fit Ubah ukuran jendela agar pas
diff --cc crates/ui-egui/src/i18n/it.tsv
index 79142363c,e2a604cbc..7458c7998
--- a/crates/ui-egui/src/i18n/it.tsv
+++ b/crates/ui-egui/src/i18n/it.tsv
@@@ -4418,10 -4440,4 +4442,11 @@@ shape Appearance Aspett
# Graphics Adapter preference (#1885)
GPU adapter Adattatore GPU
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Conferma o annulla prima la finestra di dialogo aperta del passo dell’azione
+ Pro Medium Gray Pro grigio medio
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Pro grigio chiaro
+ Pro Light Pro chiaro
+ Resize Windows to Fit Ridimensiona finestre per adattare
diff --cc crates/ui-egui/src/i18n/ja.tsv
index 3c4df7260,00bc80241..147e2b719
--- a/crates/ui-egui/src/i18n/ja.tsv
+++ b/crates/ui-egui/src/i18n/ja.tsv
@@@ -3979,10 -4001,4 +4003,11 @@@ curves Smooth スムー�
# Graphics Adapter preference (#1885)
GPU adapter GPU アダプター
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first 先に開いているアクションのステップのダイアログを確定またはキャンセルしてください
+ Pro Medium Gray プロ(中間グレー)
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray プロ(ライトグレー)
+ Pro Light プロ(ライト)
+ Resize Windows to Fit ウィンドウサイズを合わせる
diff --cc crates/ui-egui/src/i18n/ko.tsv
index 8cf48914e,c17462cc0..344cf26c6
--- a/crates/ui-egui/src/i18n/ko.tsv
+++ b/crates/ui-egui/src/i18n/ko.tsv
@@@ -3508,10 -3513,4 +3532,11 @@@ curves Smooth 매끄럽�
# Graphics Adapter preference (#1885)
GPU adapter GPU 어댑터
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first 먼저 열려 있는 액션 단계 대화 상자를 확인하거나 취소하세요
+ Pro Medium Gray 프로 중간 회색
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray 프로 밝은 회색
+ Pro Light 프로 밝게
+ Resize Windows to Fit 창 크기 맞추기
diff --cc crates/ui-egui/src/i18n/nl.tsv
index 70c2c4229,679d0818e..022efe99f
--- a/crates/ui-egui/src/i18n/nl.tsv
+++ b/crates/ui-egui/src/i18n/nl.tsv
@@@ -4061,10 -4083,4 +4085,11 @@@ curves Smooth Vloeiend make
# Graphics Adapter preference (#1885)
GPU adapter GPU-adapter
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Bevestig of annuleer eerst het geopende dialoogvenster van de handelingsstap
+ Pro Medium Gray Pro middelgrijs
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Pro lichtgrijs
+ Pro Light Pro licht
+ Resize Windows to Fit Venstergrootte aanpassen
diff --cc crates/ui-egui/src/i18n/pl.tsv
index 9d65e242b,47afcfa6d..21bf98b1a
--- a/crates/ui-egui/src/i18n/pl.tsv
+++ b/crates/ui-egui/src/i18n/pl.tsv
@@@ -3917,10 -3923,4 +3941,11 @@@ curves Smooth Wygład�
# Graphics Adapter preference (#1885)
GPU adapter Karta GPU
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Najpierw zatwierdź lub anuluj otwarte okno kroku operacji
+ Pro Medium Gray Pro (średni szary)
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Pro (jasnoszary)
+ Pro Light Pro (jasny)
+ Resize Windows to Fit Dopasuj rozmiar okien
diff --cc crates/ui-egui/src/i18n/pt-br.tsv
index 255d48655,ea9eee583..2ef20d933
--- a/crates/ui-egui/src/i18n/pt-br.tsv
+++ b/crates/ui-egui/src/i18n/pt-br.tsv
@@@ -4091,159 -4113,4 +4115,160 @@@ layerLabel No Color Sem co
# Graphics Adapter preference (#1885)
GPU adapter Adaptador de GPU
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Confirme ou cancele primeiro a caixa de diálogo aberta da etapa da ação
+
+# Channels panel menu: channel commands, spot channels, Quick Mask, Color Indicates
+ New Channel… Novo canal…
+ Duplicate Channel Duplicar canal
+ Delete Channel Excluir canal
+ Rename Channel… Renomear canal…
+ New Spot Channel… Novo canal de cor especial…
+ Merge Spot Channel Mesclar canal de cor especial
+ Convert to Alpha Channel Converter em canal alfa
+ Split Channels Dividir canais
+ Merge Channels… Mesclar canais…
+ Exit Quick Mask Sair da máscara rápida
+ Color Indicates Masked Areas A cor indica áreas mascaradas
+ Color Indicates Selected Areas A cor indica áreas selecionadas
+
+# Layer Style › Blending Options: advanced blending and Blend If
+ General Blending Mesclagem geral
+ Shallow Raso
+ Deep Profundo
+ Blend Interior Effects as Group Mesclar efeitos internos como grupo
+ Blend Clipped Layers as Group Mesclar camadas recortadas como grupo
+ Transparency Shapes Layer A transparência define a forma da camada
+ Layer Mask Hides Effects A máscara de camada oculta os efeitos
+ Vector Mask Hides Effects A máscara vetorial oculta os efeitos
+ This Layer: Esta camada:
+ Underlying Layer: Camada subjacente:
+
+# Canvas right-click menus: pasteboard color, paths and shapes
+ Dark Gray Cinza-escuro
+ Medium Gray Cinza médio
+ Select Custom Color… Selecionar cor personalizada…
+ Color Picker (Custom Canvas Color) Seletor de cores (Cor personalizada da tela de pintura)
+ Make Work Path… Criar demarcador de trabalho…
+ Create Vector Mask Criar máscara vetorial
+ Make Selection… Fazer seleção…
+ Fill Path… Preencher demarcador…
+ Clipping Path… Demarcador de corte…
+ Free Transform Path Transformação livre do demarcador
+ Unite Shapes at Overlap Unir formas na sobreposição
+ Subtract Shapes at Overlap Subtrair formas na sobreposição
+ Copy Fill Copiar preenchimento
+ Copy Complete Stroke Copiar traçado completo
+ Paste Fill Colar preenchimento
+ Paste Complete Stroke Colar traçado completo
+ Make Symmetry Path Criar demarcador de simetria
+ Disable Symmetry Path Desativar demarcador de simetria
+
+# Color Picker titles
+ Color Picker (Foreground Color) Seletor de cores (Cor de primeiro plano)
+ Color Picker (Background Color) Seletor de cores (Cor de fundo)
+ Pick Color From Image Escolher cor da imagem
+
+# Rasterize prompts
+ This layer must be rasterized before proceeding. Esta camada precisa ser rasterizada antes de continuar.
+ This type layer must be rasterized before proceeding. Its text will no longer be editable. Rasterize the type? Esta camada de texto precisa ser rasterizada antes de continuar. O texto não poderá mais ser editado. Rasterizar o texto?
+ This shape layer must be rasterized before proceeding. It will no longer be editable as a shape. Rasterize the shape? Esta camada de forma precisa ser rasterizada antes de continuar. Ela não poderá mais ser editada como forma. Rasterizar a forma?
+ This Smart Object must be rasterized before proceeding. Its contents will no longer be editable. Rasterize the Smart Object? Este objeto inteligente precisa ser rasterizado antes de continuar. O conteúdo não poderá mais ser editado. Rasterizar o objeto inteligente?
+ This fill layer must be rasterized before proceeding. Its fill content will no longer be editable. Rasterize the layer? Esta camada de preenchimento precisa ser rasterizada antes de continuar. O conteúdo do preenchimento não poderá mais ser editado. Rasterizar a camada?
+
+# GPU and display status (status bar, System Info)
+ Graphics adapter: {adapter} Adaptador gráfico: {adapter}
+ Backend: {backend} ({type}) Backend: {backend} ({type})
+ Driver: {driver} Driver: {driver}
+ GPU backend preference: {backend} Preferência de backend da GPU: {backend}
+ Selected at launch: {backend} Selecionado ao iniciar: {backend}
+ Image compositor: {processor} Compositor de imagens: {processor}
+ Window renderer: {renderer} Renderizador da janela: {renderer}
+ Graphics adapter Adaptador gráfico
+ Software adapter Adaptador de software
+ unknown type tipo desconhecido
+ Fallback: {reason} Modo alternativo: {reason}
+ This session: {reason} Nesta sessão: {reason}
+ Platform: {os} {arch} Plataforma: {os} {arch}
+ GPU retry scheduled Nova tentativa da GPU agendada
+ Save your work and restart PhotoCraft to retry GPU acceleration. CPU rendering remains active for this session. Salve seu trabalho e reinicie o PhotoCraft para tentar a aceleração por GPU novamente. A renderização pela CPU continua ativa nesta sessão.
+ GPU device was lost; using the CPU renderer. O dispositivo da GPU foi perdido; usando o renderizador da CPU.
+ GPU error; using the CPU renderer. Erro da GPU; usando o renderizador da CPU.
+ Monitor profile: {profile} Perfil do monitor: {profile}
+ Monitor profile in use: {profile} Perfil do monitor em uso: {profile}
+ Monitor profile in use on {display}: {profile} Perfil do monitor em uso em {display}: {profile}
+ Monitor profile on {display}: {profile} Perfil do monitor em {display}: {profile}
+ Monitor profile on {display} (main window): {profile} Perfil do monitor em {display} (janela principal): {profile}
+ Display profiles: {reason} Perfis de tela: {reason}
+ Display profile not used Perfil de tela não usado
+ previous reading kept; the last re-read failed: {reason} leitura anterior mantida; a última releitura falhou: {reason}
+ The canvas is shown as sRGB. Choose a monitor profile in Edit › Color Settings. A tela de pintura é exibida como sRGB. Escolha um perfil de monitor em Editar › Configurações de cores.
+ The canvas on {display} is shown as sRGB. Choose a monitor profile in Edit › Color Settings. A tela de pintura em {display} é exibida como sRGB. Escolha um perfil de monitor em Editar › Configurações de cores.
+
+# Status messages
+ Nothing to paste: the clipboard holds no image Nada para colar: a área de transferência não contém imagem
+ Opened {url} Aberto: {url}
+ Preferences saved Preferências salvas
+ Preferences were reset: {error} As preferências foram redefinidas: {error}
+ Couldn't save preferences: {error}. Retrying… Não foi possível salvar as preferências: {error}. Tentando novamente…
+ Preferences can't be saved Não é possível salvar as preferências
+ PhotoCraft keeps retrying; until a save succeeds, preference changes are lost when it closes. O PhotoCraft continua tentando; até que um salvamento dê certo, as alterações nas preferências serão perdidas ao fechar.
+ Invalid panel layout; restored the default dock Layout de painéis inválido; a disposição padrão dos painéis foi restaurada
+ Recovered {name} Recuperado: {name}
+ Autosave failed: {error} Falha ao salvar automaticamente: {error}
+ Exported presets to {path} Predefinições exportadas para {path}
+ Ran script {name} Script executado: {name}
+ Sent to the printer ({spooler}) Enviado para a impressora ({spooler})
+ Printed to {path} Impresso em {path}
+ Exported {path} ({size}) Exportado: {path} ({size})
+ Exported {path} Exportado: {path}
+ Saved a copy as {path} Cópia salva como {path}
+ Exported contents to {path} Conteúdo exportado para {path}
+ Saved {path}; image assets: {n} in {dir} Salvo: {path}; recursos de imagem: {n} em {dir}
+ Couldn't open {name}: {error} Não foi possível abrir {name}: {error}
+ Added swatch {name} Amostra adicionada: {name}
+ {message} (notes: {n}; {warning}) {message} (observações: {n}; {warning})
+ Step {step} ({id}) failed: {error} Falha na etapa {step} ({id}): {error}
+ Could not rename the action: {error} Não foi possível renomear a ação: {error}
+ Action playback failed: {error} Falha ao reproduzir a ação: {error}
+ Clone source set at {x}, {y} Origem da clonagem definida em {x}, {y}
+ Color management: {error} Gerenciamento de cores: {error}
+ No custom shape "{name}": pick one in the options bar or Window › Shapes Nenhuma forma personalizada “{name}”: escolha uma na barra de opções ou em Janela › Formas
+ {label} is not available: {reason} {label} não está disponível: {reason}
+ Open Recent is unavailable on the web Abrir recentes não está disponível na web
+ Importing {what} from {file}… Importando {what} de {file}…
+ brushes pincéis
+ gradients degradês
+ This adjustment ({key}) is kept as imported and can't be edited yet. Este ajuste ({key}) é mantido como foi importado e ainda não pode ser editado.
+ {shortcut} assigned. {shortcut} atribuído.
+ {shortcut} is already in use by {commands} and will be removed from it when you click OK. {shortcut} já está em uso por {commands} e será removido de lá quando você clicar em OK.
+
+# Panels and small controls
+ Grid view Visualização em grade
+ List view Visualização em lista
+ New Brush Preset Nova predefinição de pincel
+ Toggle the Brush Settings panel Alternar o painel Configurações do pincel
+ Scroll menu up Rolar o menu para cima
+ Scroll menu down Rolar o menu para baixo
+ {index} of {total} {index} de {total}
+ Data Set: {name} ({index}/{total}) Conjunto de dados: {name} ({index}/{total})
+ (none) (nenhum)
+ Apply {option}: {state} Aplicar {option}: {state}
+ on ativado
+ off desativado
+
+# Liquify tools (tooltips)
+ Forward Warp Deformação para frente
+ Twirl Clockwise Torcer no sentido horário
+ Twirl Counterclockwise Torcer no sentido anti-horário
+ Pucker Franzir
+ Bloat Inflar
+ Push Left Empurrar para a esquerda
+ Freeze Mask Congelar máscara
+ Thaw Mask Descongelar máscara
+ Pro Medium Gray Pro cinza médio
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Pro cinza claro
+ Pro Light Pro claro
+ Resize Windows to Fit Redimensionar janelas para caber
diff --cc crates/ui-egui/src/i18n/ru.tsv
index abf6fbd8f,8c7213d50..00fb7c3ca
--- a/crates/ui-egui/src/i18n/ru.tsv
+++ b/crates/ui-egui/src/i18n/ru.tsv
@@@ -3280,10 -3301,4 +3304,11 @@@ curves Smooth Сгладит�
# Graphics Adapter preference (#1885)
GPU adapter Адаптер GPU
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Сначала подтвердите или отмените открытый диалог шага операции
+ Pro Medium Gray Средне-серая Pro
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Светло-серая Pro
+ Pro Light Светлая Pro
+ Resize Windows to Fit Подгонять размер окон
diff --cc crates/ui-egui/src/i18n/sr.tsv
index 932c89c56,3916a18ba..52631a058
--- a/crates/ui-egui/src/i18n/sr.tsv
+++ b/crates/ui-egui/src/i18n/sr.tsv
@@@ -4372,10 -4395,4 +4397,11 @@@ shape Appearance Izgle
# Graphics Adapter preference (#1885)
GPU adapter GPU adapter
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Prvo potvrdite ili otkažite otvoreni dijalog koraka radnje
+ Pro Medium Gray Pro srednje siva
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Pro svetlosiva
+ Pro Light Pro svetla
+ Resize Windows to Fit Prilagodi veličinu prozora
diff --cc crates/ui-egui/src/i18n/tr.tsv
index 5e23c9af7,842d723d3..d6881383a
--- a/crates/ui-egui/src/i18n/tr.tsv
+++ b/crates/ui-egui/src/i18n/tr.tsv
@@@ -2254,9 -2252,11 +2254,11 @@@
Automatic uses GPU acceleration when available and falls back to CPU rendering on errors. Otomatik, mümkün olduğunda GPU hızlandırmayı kullanır ve hatalarda CPU oluşturmaya geri döner.
Switched to CPU rendering CPU oluşturmaya geçildi
GPU acceleration could not continue. Your documents are unchanged. GPU hızlandırması devam edemedi. Belgeleriniz değişmedi.
- PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft, CPU görüntü düzenleyicisini kullanıyor. Pencere hala grafik bağdaştırıcınızı kullanıyor olabilir.
+ PhotoCraft is using the CPU image compositor. The window may still use your graphics adapter. PhotoCraft, CPU görüntü birleştiricisini kullanıyor. Pencere yine de grafik bağdaştırıcınızı kullanıyor olabilir.
Retry GPU requires a restart. Save your work first. GPU'yu yeniden dene, yeniden başlatma gerektirir. Öncelikle çalışmanızı kaydedin.
+ Keep Using CPU CPU'yu Kullanmaya Devam Et
+ Retry GPU tries the graphics processor again now. GPU'yu yeniden dene, grafik işlemciyi hemen yeniden dener.
+ GPU acceleration resumed. GPU hızlandırması sürdürüldü.
- Keep Using CPU CPU'yu Kullanmaya Devam Edin
Retry GPU GPU'yu yeniden dene
Advanced Gelişmiş
GPU Backend GPU Arka Ucu
@@@ -2293,12 -2293,17 +2295,17 @@@
No patterns Desen yok
Enable {name} {name}'yi etkinleştir
Hold Alt while drawing for straight segments Düz parçalar çizerken Alt tuşunu basılı tutun
- Drag or click polygon points · hold Alt during lasso for straight segments · {add} add · {sub} before drawing subtracts Çokgen noktalarını sürükleyin veya tıklayın · düz parçalar için kement sırasında Alt tuşunu basılı tutun · {add} ekleyin · çizim çıkarmadan önce {sub}
+ Drag or click polygon points · hold Alt during lasso for straight segments · {add} add · {sub} before drawing subtracts Çokgen noktalarını sürükleyin veya tıklayın · düz parçalar için kement sırasında Alt tuşunu basılı tutun · {add} ekler · çizimden önce {sub} çıkarır
Extend Uzat
Structure: Yapı:
- Content-Aware Move Tool İçeriğe Uygun Taşıma Aracı
+ Content-Aware Move Tool İçeriğe Duyarlı Taşıma Aracı
TIFF Options TIFF Seçenekleri
Targa Options Targa Seçenekleri
+ JPEG Options JPEG Seçenekleri
+ Image Options Görüntü Seçenekleri
+ Format Options Biçim Seçenekleri
+ Baseline ("Standard") Temel (“Standart”)
+ Baseline Optimized Optimize edilmiş temel
24 bits/pixel 24 bit/piksel
32 bits/pixel 32 bit/piksel
Including layers will increase file size. Katmanların eklenmesi dosya boyutunu artıracaktır.
@@@ -4031,10 -4051,4 +4055,11 @@@ cameraData Lens Len
# Graphics Adapter preference (#1885)
GPU adapter GPU bağdaştırıcısı
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Önce açık eylem adımı iletişim kutusunu onaylayın veya iptal edin
+ Pro Medium Gray Pro Orta Gri
+ Solarized Solarize
+ Breeze Esinti
+ Pro Light Gray Pro Açık Gri
+ Pro Light Profesyonel Işık
+ Resize Windows to Fit Pencereleri sığacak şekilde boyutlandır
diff --cc crates/ui-egui/src/i18n/uk.tsv
index fc9658464,b16669585..338aacad4
--- a/crates/ui-egui/src/i18n/uk.tsv
+++ b/crates/ui-egui/src/i18n/uk.tsv
@@@ -4010,10 -4032,4 +4034,11 @@@ curves Smooth Згладит�
# Graphics Adapter preference (#1885)
GPU adapter Адаптер GPU
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Спочатку підтвердьте або скасуйте відкритий діалог кроку операції
+ Pro Medium Gray Середньосіра «Профі»
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Світло-сіра «Профі»
+ Pro Light Світла «Профі»
+ Resize Windows to Fit Підганяти розмір вікон
diff --cc crates/ui-egui/src/i18n/vi.tsv
index cc61a3b75,e9eaceb68..cbd086f38
--- a/crates/ui-egui/src/i18n/vi.tsv
+++ b/crates/ui-egui/src/i18n/vi.tsv
@@@ -3792,10 -3814,4 +3816,11 @@@ curves Smooth Làm mượ
# Graphics Adapter preference (#1885)
GPU adapter Bộ điều hợp GPU
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first Hãy xác nhận hoặc hủy hộp thoại bước hành động đang mở trước
+ Pro Medium Gray Pro xám vừa
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray Pro xám nhạt
+ Pro Light Pro sáng
+ Resize Windows to Fit Đổi cỡ cửa sổ cho vừa ảnh
diff --cc crates/ui-egui/src/i18n/zh-hans.tsv
index 816e288c0,7fe1f4535..2359ac97d
--- a/crates/ui-egui/src/i18n/zh-hans.tsv
+++ b/crates/ui-egui/src/i18n/zh-hans.tsv
@@@ -2953,10 -2958,4 +2977,11 @@@ curves Smooth 平�
# Graphics Adapter preference (#1885)
GPU adapter GPU 适配器
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first 请先确认或取消打开的动作步骤对话框
+ Pro Medium Gray 专业中灰
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray 专业浅灰
+ Pro Light 专业浅色
+ Resize Windows to Fit 调整窗口大小以适合
diff --cc crates/ui-egui/src/i18n/zh-hant.tsv
index fbd12a7fc,9e1305208..15ffd53cb
--- a/crates/ui-egui/src/i18n/zh-hant.tsv
+++ b/crates/ui-egui/src/i18n/zh-hant.tsv
@@@ -2922,10 -2943,4 +2946,11 @@@ curves Smooth 平�
# Graphics Adapter preference (#1885)
GPU adapter GPU 介面卡
+# Actions: a step dialog holds a suspended recording (#7365)
+ Confirm or cancel the open action step dialog first 請先確認或取消開啟中的動作步驟對話框
+ Pro Medium Gray 專業中灰
+ Solarized Solarized
+ Breeze Breeze
+ Pro Light Gray 專業淺灰
+ Pro Light 專業淺色
+ Resize Windows to Fit 調整視窗大小以符合
diff --cc crates/ui-egui/src/lib.rs
index 25b16e9ab,adb9d5f31..66a625019
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@@ -1520,10 -1560,8 +1563,10 @@@ impl PhotocraftApp
return Ok(Vec::new());
}
let import = self.services.import.as_ref().ok_or("no importer configured")?;
- let max_svg_group_depth = self.session.prefs().file_handling.rasterize_svg_groups_deeper_than as usize;
- let (mut doc, warnings) = import(name, bytes, max_svg_group_depth)?;
+ let opts = photocraft_engine::jobs::import_options(self.session.prefs());
- let (doc, warnings) = import(name, bytes, &opts)?;
++ let (mut doc, warnings) = import(name, bytes, &opts)?;
+ // Preferences › Raw Defaults › Resolution, as the engine's open applies it.
+ photocraft_engine::file_cmds::raw_defaults(&self.session, &warnings, &mut doc);
// Edit › Color Settings policies apply on open; Ask When Opening holds the file back
// until its prompt is answered, and later files wait behind it (`open_prompt`).
// Missing fonts are read from the document itself: it may not be open yet (#4559).
@@@ -1572,9 -1610,8 +1615,9 @@@
/// events and no Color Settings policy (which may read user-configured profile paths).
fn import_automation_document(&mut self, name: &str, bytes: &[u8]) -> Result<Vec<String>, String> {
let import = self.services.import.as_ref().ok_or("no importer configured")?;
- let max_svg_group_depth = self.session.prefs().file_handling.rasterize_svg_groups_deeper_than as usize;
- let (mut doc, warnings) = import(name, bytes, max_svg_group_depth)?;
+ let opts = photocraft_engine::jobs::import_options(self.session.prefs());
- let (doc, warnings) = import(name, bytes, &opts)?;
++ let (mut doc, warnings) = import(name, bytes, &opts)?;
+ photocraft_engine::file_cmds::raw_defaults(&self.session, &warnings, &mut doc);
// The caller records the path it read from.
self.session.add_document(doc, None);
if let Some(st) = self.session.active_mut() {
diff --cc crates/ui-egui/src/view_cmds.rs
index 3d1a29f60,e73aedc25..170750b27
--- a/crates/ui-egui/src/view_cmds.rs
+++ b/crates/ui-egui/src/view_cmds.rs
@@@ -1473,14 -1483,11 +1483,14 @@@ fn front(app: &mut PhotocraftApp, ctx:
fn save_a_copy(app: &mut PhotocraftApp) -> Result<Value, String> {
let doc = app.session.active().ok_or("no document")?.doc.clone();
let stem = doc.name.rsplit_once('.').map_or(doc.name.as_str(), |(a, _)| a);
- let suggested = format!("{stem} copy.psd");
+ // "<name> copy.psd", or with Preferences › File Handling › Do not append "copy" to filename
+ // when saving a copy the document's own name (only the extension may change), as in
+ // Photoshop (#8080).
+ let suggested = format!("{stem}{}.psd", app.session.prefs().file_handling.copy_suffix());
// The copy is of the document as it was when asked.
app.pick_save(&suggested, move |app, path| {
- // An RGB Targa asks for its bits per pixel first, and a DDS texture for its compression;
- // the copy is written from the prompt.
+ // An RGB Targa asks for its bits per pixel first, a DDS texture for its compression, and
+ // a JPEG for its JPEG Options; the copy is written from the prompt.
let parked = app.with_document(doc.id, |app| {
if crate::targa_options_ui::wants_prompt(app, &path) {
crate::targa_options_ui::park(app, path.clone(), true, "file.saveACopy")?;
diff --cc docs/file-format-parity.md
index b04a29395,d77d04420..96e47c3d2
--- a/docs/file-format-parity.md
+++ b/docs/file-format-parity.md
@@@ -1,6 -1,6 +1,6 @@@
# File-format parity
- > **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-18 · **Change:** minor (TIFF compression for scripted saves, `tiffCompression`, #5301; the Nikon D4 white level follows the sample depth (12 and 14 bit), #5978; Apply Layer Comp action mapping, #7101; Photoshop mixed-order TIFF type geometry, #4758; DDS textures save: uncompressed or BC1–BC3, optional mip chain, DDS Options in Save As (#1327); PSD smart filters: 45 filters (31 more: Blur, Surface Blur, Smart Sharpen, Diffuse, Wind, Offset, Mezzotint, Clouds, Difference Clouds, Fibers, Lens Flare and others) plus Hue/Saturation and Perspective Warp mapped both ways, #6296, #6298, #6300, #6302, #6304, #6314, #6316, #6267, #6268, FILE-215-2; large-file fixtures: a 20 MP layered PSD, a 150-layer layout, a 2 GB PSD and a 4.4 GB PSB generated at test time and round-tripped, FILE-216-2 done, #5107; earlier: PNG `sTER` stereo pairing kept on save, #6063; PDF write one flattened page via Save As / Save a Copy / CLI, #3401; CMYK Invert, Posterize and Threshold on the inks; smart filter masks on PSD open and save; Photoshop-oracle floor 188/258; lossy DNG, compression 34892, decodes with its levels and LinearizationTable applied to the stored 8-bit samples, FILE-215-11; CMYK Hue/Saturation and Color Balance keep the black ink; CMYK Posterize on the stored values, psd-tools oracle floor 242/309; CMYK adjustment layers composite on the document's inks; Photoshop-oracle floor 165/258; CMYK Brightness/Contrast on the inks, CMYK Threshold's luma; modern Brightness/Contrast's brightness curve; Photoshop-oracle floor 151/258; Lab documents composite on their stored L, a, b; Photoshop-oracle floor 152/258; Levels on whole levels at every step with Photoshop's shadow toe; Photoshop-oracle floor 146/258, psd-tools 238/309; 32-bit adjustments unclipped; Photoshop-oracle floor 149/258; mask feathers blur with their exact variance; Threshold splits on Photoshop's luminosity; a pass-through clipping base with an adjustment renders isolated; psd-tools oracle floor 240/309; 16-bit Posterize as Photoshop bins it; psd-tools oracle floor 241/309; Gradient Map luminosity; Photoshop-oracle floor 147/258; PSD: `Mt16`/`Mt32` merged transparency read; palette PNGs open in Indexed Color mode, #4804; 16-bit Lab Invert; Photoshop-oracle floor 145/258; `.atn` import maps 112 events; DDS textures open, #1327; DPX read and write, #1049; #2465 fixed: CS2 placed layers with only a `PlLd` block open their contents; Photoshop Actions `.atn` read and write; `.shc` contour files read and write; earlier the same day: indexed BMP palette mode; Save keeps a JPEG's quality and a WebP's encoding) · **Target:** Adobe Photoshop 2026
-> **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-19 · **Change:** minor (JPEG Options on Save As and Save a Copy, FILE-215-19; Photoshop mixed-order TIFF type geometry, #4758; DDS textures save: uncompressed or BC1–BC3, optional mip chain, DDS Options in Save As (#1327); PSD smart filters: 45 filters (31 more: Blur, Surface Blur, Smart Sharpen, Diffuse, Wind, Offset, Mezzotint, Clouds, Difference Clouds, Fibers, Lens Flare and others) plus Hue/Saturation and Perspective Warp mapped both ways, #6296, #6298, #6300, #6302, #6304, #6314, #6316, #6267, #6268, FILE-215-2; large-file fixtures: a 20 MP layered PSD, a 150-layer layout, a 2 GB PSD and a 4.4 GB PSB generated at test time and round-tripped, FILE-216-2 done, #5107; earlier: PNG `sTER` stereo pairing kept on save, #6063; PDF write one flattened page via Save As / Save a Copy / CLI, #3401; CMYK Invert, Posterize and Threshold on the inks; smart filter masks on PSD open and save; Photoshop-oracle floor 188/258; lossy DNG, compression 34892, decodes with its levels and LinearizationTable applied to the stored 8-bit samples, FILE-215-11; CMYK Hue/Saturation and Color Balance keep the black ink; CMYK Posterize on the stored values, psd-tools oracle floor 242/309; CMYK adjustment layers composite on the document's inks; Photoshop-oracle floor 165/258; CMYK Brightness/Contrast on the inks, CMYK Threshold's luma; modern Brightness/Contrast's brightness curve; Photoshop-oracle floor 151/258; Lab documents composite on their stored L, a, b; Photoshop-oracle floor 152/258; Levels on whole levels at every step with Photoshop's shadow toe; Photoshop-oracle floor 146/258, psd-tools 238/309; 32-bit adjustments unclipped; Photoshop-oracle floor 149/258; mask feathers blur with their exact variance; Threshold splits on Photoshop's luminosity; a pass-through clipping base with an adjustment renders isolated; psd-tools oracle floor 240/309; 16-bit Posterize as Photoshop bins it; psd-tools oracle floor 241/309; Gradient Map luminosity; Photoshop-oracle floor 147/258; PSD: `Mt16`/`Mt32` merged transparency read; palette PNGs open in Indexed Color mode, #4804; earlier: CMYK Invert, Posterize and Threshold on the inks; 16-bit Lab Invert; Photoshop-oracle floor 145/258; `.atn` import maps 112 events; DDS textures open, #1327; DPX read and write, #1049; #2465 fixed: CS2 placed layers with only a `PlLd` block open their contents; Photoshop Actions `.atn` read and write; `.shc` contour files read and write; earlier the same day: indexed BMP palette mode; Save keeps a JPEG's quality and a WebP's encoding) · **Target:** Adobe Photoshop 2026
++> **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-19 · **Change:** minor (JPEG Options on Save As and Save a Copy, FILE-215-19; TIFF compression for scripted saves, `tiffCompression`, #5301; the Nikon D4 white level follows the sample depth (12 and 14 bit), #5978; Apply Layer Comp action mapping, #7101; Photoshop mixed-order TIFF type geometry, #4758; DDS textures save: uncompressed or BC1–BC3, optional mip chain, DDS Options in Save As (#1327); PSD smart filters: 45 filters (31 more: Blur, Surface Blur, Smart Sharpen, Diffuse, Wind, Offset, Mezzotint, Clouds, Difference Clouds, Fibers, Lens Flare and others) plus Hue/Saturation and Perspective Warp mapped both ways, #6296, #6298, #6300, #6302, #6304, #6314, #6316, #6267, #6268, FILE-215-2; large-file fixtures: a 20 MP layered PSD, a 150-layer layout, a 2 GB PSD and a 4.4 GB PSB generated at test time and round-tripped, FILE-216-2 done, #5107; earlier: PNG `sTER` stereo pairing kept on save, #6063; PDF write one flattened page via Save As / Save a Copy / CLI, #3401; CMYK Invert, Posterize and Threshold on the inks; smart filter masks on PSD open and save; Photoshop-oracle floor 188/258; lossy DNG, compression 34892, decodes with its levels and LinearizationTable applied to the stored 8-bit samples, FILE-215-11; CMYK Hue/Saturation and Color Balance keep the black ink; CMYK Posterize on the stored values, psd-tools oracle floor 242/309; CMYK adjustment layers composite on the document's inks; Photoshop-oracle floor 165/258; CMYK Brightness/Contrast on the inks, CMYK Threshold's luma; modern Brightness/Contrast's brightness curve; Photoshop-oracle floor 151/258; Lab documents composite on their stored L, a, b; Photoshop-oracle floor 152/258; Levels on whole levels at every step with Photoshop's shadow toe; Photoshop-oracle floor 146/258, psd-tools 238/309; 32-bit adjustments unclipped; Photoshop-oracle floor 149/258; mask feathers blur with their exact variance; Threshold splits on Photoshop's luminosity; a pass-through clipping base with an adjustment renders isolated; psd-tools oracle floor 240/309; 16-bit Posterize as Photoshop bins it; psd-tools oracle floor 241/309; Gradient Map luminosity; Photoshop-oracle floor 147/258; PSD: `Mt16`/`Mt32` merged transparency read; palette PNGs open in Indexed Color mode, #4804; 16-bit Lab Invert; Photoshop-oracle floor 145/258; `.atn` import maps 112 events; DDS textures open, #1327; DPX read and write, #1049; #2465 fixed: CS2 placed layers with only a `PlLd` block open their contents; Photoshop Actions `.atn` read and write; `.shc` contour files read and write; earlier the same day: indexed BMP palette mode; Save keeps a JPEG's quality and a WebP's encoding) · **Target:** Adobe Photoshop 2026
Every format Photoshop 2026 (27.11.0) reads or writes, with PhotoCraft's support, fidelity and
tests. Photoshop's list comes from its `Info.plist` `CFBundleDocumentTypes`, the PiPL read/write
@@@ -24,8 -24,8 +24,8 @@@ XL are missing (gap G10). Remaining: 30
| PSD | R/W | yes | yes | 1/8/16/32-bit; Bitmap, Gray, Indexed, RGB, CMYK, Multichannel, Lab, Duotone; layers, groups, masks, vector masks, adjustment and fill layers, effects, text, shapes, smart objects (SoLd/lnk2; CS2 PlLd/lnkD read with their warp, kept as is or re-saved as SoLd once edited), smart filters (45 mapped, among them Clouds, Difference Clouds, Fibers and Lens Flare, plus Hue/Saturation, Perspective Warp, Filter Gallery with Chrome and a Camera Raw subset, rest verbatim), slices, comps, Advanced Blending. Oracle floors: Photoshop-authored 188/258, io 148/170, psd-tools 249/309; round trip ≥ 169/170, 308/309, 258/256. Known failures: #1281, #2469 (#2374, text layers, closed 2026-10-10; #2465, CS2 `PlLd`-only smart objects, fixed 2026-10-12) |
| PSB | R/W | yes | yes | Auto-switches above 2 GB (REL-212-2); generated 20 MP, 150-layer, 2 GB PSD and 4.4 GB PSB fixtures opened, saved and re-opened by io tests/large_files.rs (FILE-216-2, 2026-10-13; the 4.4 GB PSB opens on Windows); > 4 GB from the app's File › Open on Windows: #375 |
| Cloud PSD (.psdc) | R/W | no | no | Out of scope (Adobe cloud) |
-| TIFF | R/W | yes | yes | 8/16/32f, Gray/RGB/CMYK, BigTIFF, every IFD, banded parallel decode; layered TIFF both byte orders, including Photoshop mixed-order type blocks (#4758); undecodable type keeps saved pixels (FILE-215-7: extra alpha channels not written) |
+| TIFF | R/W | yes | yes | 8/16/32f, Gray/RGB/CMYK, BigTIFF, every IFD, banded parallel decode; layered TIFF both byte orders, including Photoshop mixed-order type blocks (#4758); LZW/ZIP for scripted saves by `tiffCompression`; undecodable type keeps saved pixels (FILE-215-7: extra alpha channels not written) |
- | JPEG | R/W | yes | yes | 8-bit Gray/RGB/CMYK, ICC/EXIF/XMP; Save keeps the opened file's quality (estimated from its quantisation tables, #2399); no JPEG Options dialog (quality 0–12, baseline/progressive) (FILE-215-19) |
+ | JPEG | R/W | yes | yes | 8-bit Gray/RGB/CMYK, ICC/EXIF/XMP; Save keeps the opened file's quality (estimated from its quantisation tables, #2399); Save As and Save a Copy ask JPEG Options: Quality 0–12, starting at the opened file's quality or else the Export preference, and Baseline ("Standard") / Baseline Optimized / Progressive; scripts pass `quality`/`jpegFormat`, the CLI `--jpeg-format` (FILE-215-19). Baseline Optimized fits the Huffman tables only at 4:4:4 (Gray, CMYK) or progressive: RGB is written 4:2:0, which zune-jpeg 0.5.15 decodes wrongly with fitted tables, as in Save for Web. No Matte or size preview |
| PNG | R/W | yes | yes | 8/16-bit, ICC/text; APNG first frame only; alpha channels on open (#2225); palette PNGs open in Indexed Color mode with their transparent entry (#4804); Save keeps a stereo PNG's `sTER` pairing (#6063) |
| GIF | R/W | yes | yes | File › Open keeps the first frame; New Video Layer from File and Video Frames to Layers take every frame, with the timeline rate from the delays (#572). Per-frame delays and keeping the frames in `.pcraft` are not done |
| BMP | R/W | yes | yes | 8-bit; palette BMPs open in Indexed Color mode and Indexed Color documents save as palette BMPs (no transparency) |
@@@ -142,8 -142,7 +142,9 @@@ remaining gaps in #1606 stay tracked wi
| Date | Change | Summary |
|---|---|---|
+ | 2026-10-19 | minor | JPEG Options on Save As and Save a Copy (FILE-215-19) |
+| 2026-10-18 | minor | Scripted TIFF saves take `tiffCompression` (none, LZW, ZIP), and the CLI `--tiff-compression` (#5301) |
+| 2026-10-17 | minor | `.atn`: Apply Layer Comp by name maps to `layerComp.apply` and exports as `applyComp` (#7101) |
| 2026-10-15 | minor | PSD smart filters: Clouds, Difference Clouds, Fibers and Lens Flare open as editable filters with their seeds, colours and lens, and save like Photoshop (checked against a Photoshop 27 file); render filters on a smart object work within the object, so a flare sits where Photoshop puts it |
| 2026-10-15 | minor | DDS textures save (#1327): uncompressed or BC1/BC2/BC3 (DXT1/3/5) from a clean-room block encoder, optional box-filtered mip chain, legacy header; DDS Options in Save As and Save a Copy, `ddsCompression`/`ddsMipmaps` for scripts, the CLI and MCP |
| 2026-10-16 | minor | PSD smart filters: Perspective Warp (`perspectiveWarpTransform`: `vertices`, `warpedVertices`, `quads` of vertex indices, document pixels) opens as `layer.smartObjects.perspectiveWarp`, one plane per quad, and re-renders warped; save writes the original item with only the geometry rewritten, or a new one in Photoshop's layout; inconsistent descriptors stay verbatim (FILE-215-2, #6268) |
diff --cc docs/gaps.md
index b00f53378,cade40710..df093f136
--- a/docs/gaps.md
+++ b/docs/gaps.md
@@@ -1,6 -1,6 +1,6 @@@
# Where PhotoCraft falls short of Photoshop
- > **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-19 · **Change:** minor (G14: the Nikon D4 white level follows the sample depth, so 12-bit D4 NEFs no longer open 2.6 stops dark, #5978; G14: a Nikon NEF's Adobe RGB preview is read as Adobe RGB (maker-note ColorSpace 0x001E), #5987; Apply Layer Comp action mapping, #7101; G9: Preferences › File Handling › Save in Background takes effect, #6207, 24 of 169 preferences do nothing; G7: Content-Aware Move previews every selection the command takes, coarse then exact, TOOL-213-4 done, #6680; G4: Pattern Stamp and Background Eraser draw live, TOOL-213-7; G9: Animated Zoom pref read: holding the Zoom tool zooms continuously, #6210, prefs that do nothing 25 of 166; G2: a cancelled 24 MP Gaussian Blur job stops in at most 44 ms, P25 under its 200 ms budget in local runs, baseline not re-run, #6205; G1: generated large-file fixtures, a 4.38 GB PSB opens on Windows through io, FILE-216-2 done, #5107; G9: fill and adjustment layers copy and paste whole, #2344; G1: smart filter masks show on PSD open, Photoshop-oracle floor 188/258; G10: DPX read and write, #1049, Cineon read; G1: CMYK Hue/Saturation and Color Balance keep the black ink; G1: CMYK Posterize on the stored values, psd-tools oracle floor 242/309; G1: CMYK adjustment layers composite on the document's inks, Photoshop-oracle floor 165/258; G1: CMYK Brightness/Contrast on the inks, CMYK Threshold's luma; G1: modern Brightness/Contrast's brightness curve matches Photoshop, Photoshop-oracle floor 151/258; G1: Lab documents composite on their stored L, a, b, Photoshop-oracle floor 152/258; G1: Levels on whole levels at every step, Photoshop-oracle floor 146/258, psd-tools 238/309; G1: 32-bit Brightness/Contrast legacy, Channel Mixer, Photo Filter and Black & White tint unclipped as in Photoshop, Photoshop-oracle floor 149/258; G1: mask feathers blur with their exact variance, psd-tools oracle floor 240/309; G1: Threshold splits on Photoshop's luminosity, psd-tools oracle floor 241/309; G1: pass-through clipping base with an adjustment renders isolated, psd-tools oracle floor 240/309; G1: 16-bit Posterize as Photoshop bins it, psd-tools oracle floor 241/309; G1: Gradient Map driven by the W3C luminosity, Photoshop-oracle floor 147/258; G7: Field Blur's on-canvas pins, #3373; G4: Hue Jitter amount track, #3825 partial; G4: minimum field interaction, #3825 partial; G1: CMYK Invert, Posterize and Threshold on the inks, 16-bit Lab Invert; Photoshop-oracle floor 145/258; G11: `.atn` import maps 112 events: Select and Mask, Filter Gallery Spatter, Ripple, Crystallize, Pattern Fill layers, mask targeting, Step Backward, nudges in points, Bitmap mode; G5: Free Transform H/V skew fields; G9: toolbar tool shortcut editing; refreshed against main: G2, G5, G7, G9, G10, G13, G14, G17 items that landed; G10: DPX read and write, #1049; G4: checkbox-only Brush Settings rows; G11: Load/Save Actions `.atn` landed, AUTO-219-2 partial; G5: hold-a-key spring-loaded tools landed, #2672; G1: #2465 fixed; stale missing-tool rows corrected: Color Replacement, Red Eye and Add/Delete Anchor Point are live tools, so only Art History Brush is missing; no estimate changed) · **Target:** Adobe Photoshop 2026
-> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-19 · **Change:** minor (G10: JPEG Options dialog landed, FILE-215-19; G9: Preferences › File Handling › Save in Background takes effect, #6207, 24 of 169 preferences do nothing; G7: Content-Aware Move previews every selection the command takes, coarse then exact, TOOL-213-4 done, #6680; G4: Pattern Stamp and Background Eraser draw live, TOOL-213-7; G9: Animated Zoom pref read: holding the Zoom tool zooms continuously, #6210, prefs that do nothing 25 of 166; G2: a cancelled 24 MP Gaussian Blur job stops in at most 44 ms, P25 under its 200 ms budget in local runs, baseline not re-run, #6205; G1: generated large-file fixtures, a 4.38 GB PSB opens on Windows through io, FILE-216-2 done, #5107; G9: fill and adjustment layers copy and paste whole, #2344; G1: smart filter masks show on PSD open, Photoshop-oracle floor 188/258; G10: DPX read and write, #1049, Cineon read; G1: CMYK Hue/Saturation and Color Balance keep the black ink; G1: CMYK Posterize on the stored values, psd-tools oracle floor 242/309; G1: CMYK adjustment layers composite on the document's inks, Photoshop-oracle floor 165/258; G1: CMYK Brightness/Contrast on the inks, CMYK Threshold's luma; G1: modern Brightness/Contrast's brightness curve matches Photoshop, Photoshop-oracle floor 151/258; G1: Lab documents composite on their stored L, a, b, Photoshop-oracle floor 152/258; G1: Levels on whole levels at every step, Photoshop-oracle floor 146/258, psd-tools 238/309; G1: 32-bit Brightness/Contrast legacy, Channel Mixer, Photo Filter and Black & White tint unclipped as in Photoshop, Photoshop-oracle floor 149/258; G1: mask feathers blur with their exact variance, psd-tools oracle floor 240/309; G1: Threshold splits on Photoshop's luminosity, psd-tools oracle floor 241/309; G1: pass-through clipping base with an adjustment renders isolated, psd-tools oracle floor 240/309; G1: 16-bit Posterize as Photoshop bins it, psd-tools oracle floor 241/309; G1: Gradient Map driven by the W3C luminosity, Photoshop-oracle floor 147/258; G7: Field Blur's on-canvas pins, #3373; G4: Hue Jitter amount track, #3825 partial; G4: minimum field interaction, #3825 partial; G1: CMYK Invert, Posterize and Threshold on the inks, 16-bit Lab Invert; Photoshop-oracle floor 145/258; G11: `.atn` import maps 112 events: Select and Mask, Filter Gallery Spatter, Ripple, Crystallize, Pattern Fill layers, mask targeting, Step Backward, nudges in points, Bitmap mode; G5: Free Transform H/V skew fields; G9: toolbar tool shortcut editing; refreshed against main: G2, G5, G7, G9, G10, G13, G14, G17 items that landed; G10: DPX read and write, #1049; G4: checkbox-only Brush Settings rows; G11: Load/Save Actions `.atn` landed, AUTO-219-2 partial; G5: hold-a-key spring-loaded tools landed, #2672; G1: #2465 fixed; stale missing-tool rows corrected: Color Replacement, Red Eye and Add/Delete Anchor Point are live tools, so only Art History Brush is missing; no estimate changed) · **Target:** Adobe Photoshop 2026
++> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-19 · **Change:** minor (G14: the Nikon D4 white level follows the sample depth, so 12-bit D4 NEFs no longer open 2.6 stops dark, #5978; G14: a Nikon NEF's Adobe RGB preview is read as Adobe RGB (maker-note ColorSpace 0x001E), #5987; Apply Layer Comp action mapping, #7101; G10: JPEG Options dialog landed, FILE-215-19; G9: Preferences › File Handling › Save in Background takes effect, #6207, 24 of 169 preferences do nothing; G7: Content-Aware Move previews every selection the command takes, coarse then exact, TOOL-213-4 done, #6680; G4: Pattern Stamp and Background Eraser draw live, TOOL-213-7; G9: Animated Zoom pref read: holding the Zoom tool zooms continuously, #6210, prefs that do nothing 25 of 166; G2: a cancelled 24 MP Gaussian Blur job stops in at most 44 ms, P25 under its 200 ms budget in local runs, baseline not re-run, #6205; G1: generated large-file fixtures, a 4.38 GB PSB opens on Windows through io, FILE-216-2 done, #5107; G9: fill and adjustment layers copy and paste whole, #2344; G1: smart filter masks show on PSD open, Photoshop-oracle floor 188/258; G10: DPX read and write, #1049, Cineon read; G1: CMYK Hue/Saturation and Color Balance keep the black ink; G1: CMYK Posterize on the stored values, psd-tools oracle floor 242/309; G1: CMYK adjustment layers composite on the document's inks, Photoshop-oracle floor 165/258; G1: CMYK Brightness/Contrast on the inks, CMYK Threshold's luma; G1: modern Brightness/Contrast's brightness curve matches Photoshop, Photoshop-oracle floor 151/258; G1: Lab documents composite on their stored L, a, b, Photoshop-oracle floor 152/258; G1: Levels on whole levels at every step, Photoshop-oracle floor 146/258, psd-tools 238/309; G1: 32-bit Brightness/Contrast legacy, Channel Mixer, Photo Filter and Black & White tint unclipped as in Photoshop, Photoshop-oracle floor 149/258; G1: mask feathers blur with their exact variance, psd-tools oracle floor 240/309; G1: Threshold splits on Photoshop's luminosity, psd-tools oracle floor 241/309; G1: pass-through clipping base with an adjustment renders isolated, psd-tools oracle floor 240/309; G1: 16-bit Posterize as Photoshop bins it, psd-tools oracle floor 241/309; G1: Gradient Map driven by the W3C luminosity, Photoshop-oracle floor 147/258; G7: Field Blur's on-canvas pins, #3373; G4: Hue Jitter amount track, #3825 partial; G4: minimum field interaction, #3825 partial; G1: CMYK Invert, Posterize and Threshold on the inks, 16-bit Lab Invert; Photoshop-oracle floor 145/258; G11: `.atn` import maps 112 events: Select and Mask, Filter Gallery Spatter, Ripple, Crystallize, Pattern Fill layers, mask targeting, Step Backward, nudges in points, Bitmap mode; G5: Free Transform H/V skew fields; G9: toolbar tool shortcut editing; refreshed against main: G2, G5, G7, G9, G10, G13, G14, G17 items that landed; G10: DPX read and write, #1049; G4: checkbox-only Brush Settings rows; G11: Load/Save Actions `.atn` landed, AUTO-219-2 partial; G5: hold-a-key spring-loaded tools landed, #2672; G1: #2465 fixed; stale missing-tool rows corrected: Color Replacement, Red Eye and Add/Delete Anchor Point are live tools, so only Art History Brush is missing; no estimate changed) · **Target:** Adobe Photoshop 2026
Every known shortfall against Photoshop 2026 (27.11.0), one entry each, ranked by user impact
on the way to beta. This is the work list agents pick from: take the highest-ranked entry that
@@@ -304,9 -290,9 +304,10 @@@ what an agent can't finish alone
| Date | Change | Summary |
|---|---|---|
+ | 2026-10-19 | minor | G10: JPEG Options dialog landed (FILE-215-19); no readiness percentage or estimate changed |
| 2026-10-15 | minor | G1 / #5972 A1: render only provably constant-RGB `GdFl` noise fills; variable noise synthesis remains open |
| 2026-10-18 | minor | G9: with no selection, Copy takes fill and adjustment layers whole and Paste recreates them (#2344); UI-217-23 stays partial (a single pixel layer copies its pixels only); estimate unchanged |
+| 2026-10-17 | minor | G11: `.atn` Apply Layer Comp imports, plays and exports by comp name (#7101); other reference forms remain unsupported |
| 2026-10-15 | minor | G2: a cancelled 24 MP Gaussian Blur job stops within 44 ms max (P25, budget 200 ms; was about 400 ms; local runs, baseline not re-run), the uncancelled job on a locked-transparency layer about 40% faster; #6205 |
| 2026-10-15 | minor | G9: Animated Zoom preference takes effect (hold the Zoom tool to zoom continuously, #6210); prefs that do nothing 25 of 166; no estimate changed |
| 2026-10-16 | minor | G7: Content-Aware Move's live preview covers every selection the command takes (over 256 × 256: a coarse result solved scaled down, then the exact one); TOOL-213-4 done (#6680) |
diff --cc docs/ui-parity.md
index a04cedf4f,8ff3d40bf..e612fe18f
--- a/docs/ui-parity.md
+++ b/docs/ui-parity.md
@@@ -1,6 -1,6 +1,6 @@@
# UI parity: tools, handles, modifiers and feel
- > **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-21 · **Change:** minor (Hand tool ⌘ / ⌥ are Zoom In / Zoom Out while held, #6434; the wheel steps value fields, #5473; a dragged guide shows its X or Y beside the pointer, #7680; Type options bar "T" icon scrubs the font size, #6437; Animated Zoom: holding the Zoom tool zooms continuously, #6210; shape Density and Feather, TOOL-214-12, #5846; Pen Auto Add/Delete on the path being drawn, #6140; Show Transform Controls frames every selected layer; guide keys and clicks; menu bar from the keyboard, #4988; Crop tool Content-Aware Fill; on-canvas corner radius widgets, TOOL-214-12; Curvature Pen edits the active path; Clip Thumbnails to Layer Bounds; Pen ⇧ 45°; last selected tool restored at launch; Layers panel filter-type dropdown with Kind, Name and Mode, #5048; Free Transform box and marching ants follow the selection, #5297; History: the trash deletes the selected snapshot, rows drag onto the trash, #5324; smart filter reordering by drag; smart object perspective row corrected to done, #426; Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows; stale missing-tool rows corrected: Color Replacement, Red Eye and the Add/Delete Anchor Point pair are live toolbar tools, Frame landed; no percentage changed; selection-modifier and ⌥-wheel rows match their tests) · **Target:** Adobe Photoshop 2026
-> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-21 · **Change:** minor (Move tool: dragged selected pixels take their own outline as the selection, #7538; Animated Zoom: holding the Zoom tool zooms continuously, #6210; shape Density and Feather, TOOL-214-12, #5846; Pen Auto Add/Delete on the path being drawn, #6140; Show Transform Controls frames every selected layer; guide keys and clicks; menu bar from the keyboard, #4988; Crop tool Content-Aware Fill; on-canvas corner radius widgets, TOOL-214-12; Curvature Pen edits the active path; Clip Thumbnails to Layer Bounds; Pen ⇧ 45°; last selected tool restored at launch; Layers panel filter-type dropdown with Kind, Name and Mode, #5048; Free Transform box and marching ants follow the selection, #5297; History: the trash deletes the selected snapshot, rows drag onto the trash, #5324; smart filter reordering by drag; smart object perspective row corrected to done, #426; Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows; stale missing-tool rows corrected: Color Replacement, Red Eye and the Add/Delete Anchor Point pair are live toolbar tools, Frame landed; no percentage changed; selection-modifier and ⌥-wheel rows match their tests) · **Target:** Adobe Photoshop 2026
++> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-21 · **Change:** minor (Hand tool ⌘ / ⌥ are Zoom In / Zoom Out while held, #6434; the wheel steps value fields, #5473; a dragged guide shows its X or Y beside the pointer, #7680; Type options bar "T" icon scrubs the font size, #6437; Move tool: dragged selected pixels take their own outline as the selection, #7538; Animated Zoom: holding the Zoom tool zooms continuously, #6210; shape Density and Feather, TOOL-214-12, #5846; Pen Auto Add/Delete on the path being drawn, #6140; Show Transform Controls frames every selected layer; guide keys and clicks; menu bar from the keyboard, #4988; Crop tool Content-Aware Fill; on-canvas corner radius widgets, TOOL-214-12; Curvature Pen edits the active path; Clip Thumbnails to Layer Bounds; Pen ⇧ 45°; last selected tool restored at launch; Layers panel filter-type dropdown with Kind, Name and Mode, #5048; Free Transform box and marching ants follow the selection, #5297; History: the trash deletes the selected snapshot, rows drag onto the trash, #5324; smart filter reordering by drag; smart object perspective row corrected to done, #426; Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows; stale missing-tool rows corrected: Color Replacement, Red Eye and the Add/Delete Anchor Point pair are live toolbar tools, Frame landed; no percentage changed; selection-modifier and ⌥-wheel rows match their tests) · **Target:** Adobe Photoshop 2026
How PhotoCraft's direct manipulation compares with Photoshop 2026 (27.11.0): the toolbox, the
handles and modifier keys of each gesture, nudging, snapping, numeric precision, navigation,