Commit Graph
3891 Commits
Author SHA1 Message Date
David Mann 0ee627e2fc Merge main into #8858 2026-11-01 14:22:49 +01:00
David Mann 115d20fd74 Merge main into #7642 2026-11-01 14:18:26 +01:00
aiongg 713197635d Merge origin/main into prefs/gpu-adapter-typed-read 2026-11-01 13:16:28 +00:00
Khawar Zamman Wani 97a83f074f Bound PSD layer and mask import memory before decoding (#10503)
* Bound PSD import pixel storage before decoding

* Include ZIP inflater workspace in PSD preflight

* PSD import: budget unknown-mode layers, stop after a fatal layer error, keep best-effort for non-allocation limits (#8593 review)
2026-11-01 12:33:09 +01:00
Hector VillarrealandClaude Opus 5.5 8988b6bfd0 Actions: play Remove Background with no selection in the playback test (CodeRabbit review on tests.rs:3491)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 05:25:26 -06:00
Hector VillarrealandClaude Opus 5.5 f2e7ced6c2 Actions: check the Remove Background mask's values in the playback test (CodeRabbit review on tests.rs:3489)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 03:47:25 -06:00
yoriswind de858167e9 Make inherited Batch action effect observable in regression 2026-11-01 01:40:43 -08:00
Hector VillarrealandClaude Opus 5.5 df7e673309 Actions: check that Focus Area, Select Sky and Remove Background steps do their work (CodeRabbit review on tests.rs:3433)
The playback test counted three steps run, which a step that succeeds
without changing anything also passes (Select Sky reports "changed":
false when it finds no sky). Each step now plays on its own over a smooth
blue sky above textured ground, with a textured disc: Focus Area must
select the ground and not the sky, Select Sky the sky and not the ground,
and Remove Background must mask the layer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 03:23:25 -06:00
Hector VillarrealandClaude Opus 5.5 e1fb19f4d0 Actions: keep a Smart Sharpen, Oil Paint or Select Sky step that records a key twice (CodeRabbit review on steps_image.rs:629)
A descriptor may hold the same key more than once. `only_keys` admitted
both and `setting` read the first, so a Smart Sharpen step with two `Amnt`
(or `Rds` and `Rds `) played the first and saved back one. Oil Paint and
Select Sky read through the same `setting`. It now treats a key recorded
more than once, compared without its space padding, as a value it can't
take, so the step stays a Photoshop step (as #10629 does for Distort).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 03:19:57 -06:00
RickiNanoandClaude Opus 5.5 586563fc2b Address review: one group-name set for clashes, test the .grd prompt (#10640)
- free_group's brush check builds the set of group names once instead of
  scanning every preset for each numbered candidate.
- reimporting_a_gradient_file_asks_before_touching_its_group covers the
  gradient branch of the prompt: no prompt for a new group, Cancel imports
  nothing, Import as New Group adds "Fire (2)", Replace swaps "Fire" alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 10:18:24 +01:00
yoriswind a5636fa3e7 Preserve embedded Batch action scopes in droplets 2026-11-01 01:14:25 -08:00
Hector VillarrealandClaude Opus 5.5 d7bedfdd97 Actions: keep an Oil Paint step outside the command's ranges (FredApps review)
filter.stylize.oilPaint takes a stylization and scale of 0.1..10 and a
cleanliness, bristle detail and shine of 0..10, and clamps anything else
when it plays. The importer accepted any finite value, so such a step
played clamped and saved back unchanged. It now keeps the Photoshop step,
and export refuses those values instead of writing them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 03:08:49 -06:00
Hector VillarrealandClaude Opus 5.5 72eb3a0451 Actions: test every Filter Gallery effect's defaults round trip and match the command's schema (FredApps review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 02:59:32 -06:00
Hector VillarrealandClaude Opus 5.5 4ed3f5b591 Actions: keep a Custom step outside the command's scale, offset or cell range (FredApps review)
filter.other.custom plays a scale of 1..9999, an offset of -9999..9999
and kernel cells of -999..999, and clamps anything else when it plays,
so Scl 0 played as 1 and saved back as 0. Such a step now keeps the
Photoshop step, and export refuses those values. The matrix length is
checked before its cells are collected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 02:54:18 -06:00
RickiNanoandClaude Opus 5.5 122e55a4a0 Ask before re-importing a brush or gradient file over its group (#10640)
Importing an .abr or .grd whose name matched an existing group silently
deleted that group's user presets (edited or moved-in ones included); the
preset libraries are outside document history, so it could not be undone.

- brush.presets.importAbr / gradient.presets.importGrd: `replace` now
  defaults to false; a taken group name imports beside it as "Kit (2)",
  "Kit (3)"…, and the result's `group` names the one it landed in.
- UI: when the group already holds the user's presets, a prompt asks
  Import as New Group (default) / Replace (can't be undone) / Cancel.
  Agents drive it with ui.dialog.set {"choice":"replace"} / confirm / cancel.
- The status bar names the group the file landed in.

Fixes #10640

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 09:49:33 +01:00
Hector VillarrealandClaude Opus 5.5 b774a20b23 Actions: test that a Match Color step naming a source is kept (FredApps review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 02:48:39 -06:00
Hector VillarrealandClaude Opus 5.5 244082fb2c Actions: test that Wave's generators above 999 load clamped (FredApps review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 02:42:54 -06:00
Hector VillarrealandClaude Opus 5.5 05bbed220d Actions: play mapped Focus Area, Select Sky and Remove Background steps (FredApps review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 02:37:44 -06:00
Hector VillarrealandClaude Opus 5.5 cfc4c19eb8 Actions: keep a Smart Sharpen step outside the command's amount and radius limits (FredApps review)
filter.sharpen.smartSharpen takes an amount of 1..500 % and a radius of
0.1..64 px and rejects anything else. The importer accepted any finite
value, so such a step mapped and then failed when it played. It now keeps
the Photoshop step, and export refuses those values instead of writing
them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 02:35:44 -06:00
yoriswind da2c9a0a5d Retain nested Batch results and capture Batch action dependencies 2026-11-01 01:20:13 -07:00
yoriswind 1f486f73e8 Document nested Batch result retention 2026-11-01 00:22:02 -07:00
Hector VillarrealandClaude Opus 5.5 b67fb07557 Actions panel: Save Actions… suggests a Windows-safe name for device and control-character sets (CodeRabbit review on crates/ui-egui/src/panels/actions/tests.rs:883)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 01:07:16 -06:00
Hector VillarrealandClaude Opus 5.5 b544021d49 Actions: recording into an empty loaded set keeps its exact name (CodeRabbit review on crates/engine/src/cmd/atn_cmds/files.rs:65)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 00:59:36 -06:00
yoriswind fe1d1c5d70 Keep nested Batch outcomes in failed action results 2026-10-31 23:45:42 -07:00
Hector VillarrealandClaude Opus 5.5 63c541342e Actions: Save Actions… writes an empty New Set set (FredApps review)
An empty set made with New Set lasted only the session, and Save
Actions… on it failed with "no actions in a set named …". Photoshop
saves an empty set to the .atn, and the ATN writer handles a set with no
actions, so `actions.save` now writes it; loading such a file brings it
back as an empty folder (once, however often it is loaded). Saving every
action with none is still refused, as is a set that doesn't exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 00:29:37 -06:00
Hector VillarrealandClaude Opus 5.5 d244f11a85 Actions: Save Actions… finds a set by its exact name (FredApps review)
A set name with surrounding spaces comes from a Photoshop .atn (load
keeps the file's name) or an older actions.json, and New Action records
into such a set under that exact name. `actions.save` trimmed the name
it was given and then compared exactly, so Save Actions… on that set
failed with "no actions in a set named …". It now takes an existing
set's exact name, as `actions.record` does, and trims any other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 00:28:04 -06:00
Hector VillarrealandClaude Opus 5.5 f8ec05858a Actions: load Neon Glow without a colour in Photoshop's blue (CodeRabbit review on steps_gallery.rs:559)
A Neon Glow step recorded without `Clr ` glows in Photoshop's default
colour, (0, 0, 255) per the event reference, but loaded without
`glowColor` and so played PhotoCraft's own default (0, 158, 255). It now
loads with `glowColor` "#0000ff", which saves back as that RGBC colour. A
PhotoCraft step without `glowColor` still saves the colour it plays with.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:54:53 -06:00
Hector VillarrealandClaude Opus 5.5 77d72957dd Actions: keep a Match Color step outside the command's range (CodeRabbit review on steps_channels.rs:113)
Match Color's Luminance and Color Intensity take 1..200 and Fade 0..100. The
event reference records no clamp for them, so a recorded value outside those
ranges is kept as a Photoshop step instead of loading as a step the command
plays clamped. Export refuses such a value instead of writing it unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:51:12 -06:00
Hector VillarrealandClaude Opus 5.5 889f3e2e77 Actions: keep a Trap step narrower than 1 px (CodeRabbit review on steps_channels.rs:72)
Photoshop clamps a Trap width above 32767 px, but its minimum wasn't measured,
so a recorded width below the command's 1 px is kept as a Photoshop step
instead of loading as a Trap that rounds to 0 px and does nothing. Export
refuses such a width as it does one above 32767 px.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:50:32 -06:00
Hector VillarrealandClaude Opus 5.5 898176f7f7 Actions: keep a Wave step the command can't play (CodeRabbit review on steps_distort.rs:147)
Photoshop clamps Wave's wavelengths and amplitudes to 1..999, but
filter.distort.wave takes wavelengthMin 1..998, wavelengthMax 2..999 and
amplitudeMin 1..998, so `WLMn` 999, `WLMx` 1 or `AmMn` 999 mapped to a
step that failed when it played. Such a step now stays a Photoshop step,
and export refuses those values. A minimum above its maximum, which the
command takes, still maps and plays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:22:24 -06:00
Hector VillarrealandClaude Opus 5.5 6699a83366 Actions: save Neon Glow without a colour with the colour it plays (CodeRabbit review on steps_gallery.rs:576)
A `filter.gallery.neonGlow` step without `glowColor` plays with the
effect's default glow colour, but export refused it. It now writes that
colour as Photoshop's RGBC components, unrounded (0, 158.1, 255), so the
saved step names exactly the colour PhotoCraft plays rather than a
`#009eff` rounded to whole components.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:18:47 -06:00
Hector VillarrealandClaude Opus 5.5 59da5e229a Actions: refuse a Filter Gallery integer outside its setting's range (CodeRabbit review on steps_gallery.rs:567)
An integer key only checked for a fraction and the i32 range, so
`edgeWidth: 99` saved as `EdgW` 99, which Photoshop plays clamped and
which loads back as 14. A value outside the setting's own min..max now
refuses the step, as fields.rs refuses rather than clamps (#7287).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:17:09 -06:00
Hector VillarrealandClaude Opus 5.5 77229089f2 Actions: keep a Smart Sharpen step whose amount or radius is in another unit (CodeRabbit review on steps_image.rs:602)
Import read `Amnt` and the radius with `num`, which drops the unit, but the
step saves `Amnt` in `#Prc` and the radius in `#Pxl`, so a value in another
unit (or a bare number) loaded and saved back in the step's unit. Import now
takes only those units, for the padded `Rds ` and the unpadded `Rds` alike,
and keeps anything else as a Photoshop step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:50:44 -06:00
Hector VillarrealandClaude Opus 5.5 527dfaa591 Actions: keep an Oil Paint step whose setting has a unit or another number type (CodeRabbit review on steps_image.rs:548)
Import read Oil Paint's settings with `num`, which takes any number and drops
a unit, so a recorded `#Prc` stylization or an integer bristle detail loaded
and saved back as a plain double, and a fractional light direction loaded and
then couldn't be saved. Import now takes the types Photoshop records and the
step writes back (doubles, and an integer `LghD`), and keeps anything else
as a Photoshop step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:47:59 -06:00
Hector VillarrealandClaude Opus 5.5 97354e6269 Actions: keep a Wave step with a fractional scale (CodeRabbit review on steps_distort.rs:151)
Import rounded `SclH`/`SclV` before comparing with 100, so a recorded 99.6
loaded as an unscaled Wave and saved back as 100. A fractional scale now
keeps the Photoshop step: the step can only write the integer 100.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:45:16 -06:00
Hector VillarrealandClaude Opus 5.5 427c59d32a Actions: keep a Distort step whose enumeration has another type (CodeRabbit review on steps_distort.rs:71)
Import read an enumeration's value and ignored its type, so `Cnvr` recorded
as `Ordn`/`RctP` loaded as Polar Coordinates and saved back as `Cnvr`/`RctP`.
Each enumeration (and Wave's `UndA`) now loads only with the type Photoshop
records and the step saves back; another type keeps the Photoshop step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:43:52 -06:00
Hector VillarrealandClaude Opus 5.5 13f6e07678 Actions: keep a Distort step that records a key twice (CodeRabbit review on steps_distort.rs:19)
A descriptor may hold the same key more than once. `setting` read the first
and `only_keys` admitted both, so a step with two `Amnt` played the first and
saved back one. `setting` now treats a key recorded more than once as a value
it can't take, so the step stays a Photoshop step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:43:12 -06:00
Hector VillarrealandClaude Opus 5.5 17c5d41734 Actions: keep a Match Color step whose setting isn't an integer (CodeRabbit review on steps_channels.rs:100)
Import took any number for `Lght`, `ClrR` and `Fade`, but export writes them
as integers and refuses a fraction, so a recorded 99.5 loaded and then could
not be saved; a whole double, a large integer or a unit double would have
saved back as a different type. Import now takes only an integer, as
export writes it, and keeps anything else as a Photoshop step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:41:11 -06:00
yoriswind c5fc78bee1 Keep ATN event codes distinct from TEXT names 2026-10-31 21:41:03 -07:00
Hector VillarrealandClaude Opus 5.5 926008b90b Actions: keep a Trap step whose width isn't in pixels (CodeRabbit review on steps_channels.rs:61)
Import read `Wdth` with `num`, which drops the unit, so a width in points or
millimetres (or a bare number) loaded as that many pixels and saved back as
`#Pxl`. Import now takes only a `#Pxl` unit double, the one Trap saves, and
keeps any other width as a Photoshop step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:38:29 -06:00
Hector VillarrealandClaude Opus 5.5 94bce3b6d5 Actions: save Filter Gallery stroke direction with Photoshop's StrD type (CodeRabbit review on steps_gallery.rs:573)
Export wrote each enumeration with its key as the type. Photoshop's terminology
gives stroke direction (`SDir`, Graphic Pen and Sprayed Strokes) its own type,
`StrD` (strokeDirectionType), so those steps saved differently from Photoshop.
Texture keeps `TxtT` as its type: that is how Photoshop records Glass
(`TxtT` / `TxtT`), and its terminology has no separate texture type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:36:20 -06:00
yoriswind 9959f8d5c2 Keep noncanonical Group F descriptor encodings intact 2026-10-31 21:20:52 -07:00
Mohamed MahjoubandClaude baf8e654e8 Keep a layer's place on its board when dragged to another artboard (#10489)
Artboards share one canvas, so a layer dragged from one board onto another in
the Layers panel (layer.moveTo, including the Alt-drag copy) changed parent but
kept its old canvas position, outside the board it now belonged to, and the
board clipped it away.

apply_move now shifts a layer that lands on a different board by the offset
between the two boards' origins, through move_layers (the Move tool's path).
Reordering within a board, leaving or joining a board from the top level,
position-locked layers and moving a board itself are unchanged. The Layers
panel's drop preview uses apply_move, so it shows the same result.

Locks are read before the drop as well as after, so a layer whose position
was locked only through the board it left stays put (review follow-up).

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 05:14:15 +01:00
Hector VillarrealandClaude Opus 5.5 f3f046871e Actions: load a Wave seed's exact 32 bits or keep the step (CodeRabbit review on crates/engine/src/cmd/atn_cmds/steps_distort.rs:145)
`RndS` went through `as i32`, so a `LargeInteger` seed above i32::MAX
saturated to 2147483647 and a fractional one was truncated: both played
with another seed. The seed now loads only when it is a whole number in
i32::MIN..=u32::MAX (a negative one still as its signed bit pattern);
anything else keeps the Photoshop step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:00:57 -06:00
Hector VillarrealandClaude Opus 5.5 6042bb68e8 Actions: refuse a Distort step outside Photoshop's range (CodeRabbit review on crates/engine/src/cmd/atn_cmds/steps_distort.rs:88)
`keys_to` only checked that an integer fit in 32 bits, so a Pinch
`amount` of 500 was written as is and loaded back clamped to 100. Each
integer key, Wave's included, now refuses a value outside its
`min..=max`, like other out-of-range exports (fields.rs, #7287).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:59:54 -06:00
Hector VillarrealandClaude Opus 5.5 9b2be9a333 Actions: keep a Distort step with a wrong-typed setting (CodeRabbit review on crates/engine/src/cmd/atn_cmds/steps_distort.rs:61)
A present integer or enumeration key of another type (an `Amnt` as a
Boolean, a `SphM` as text), or a Wave `SclH`/`SclV`, `UndA` or `RndS` that
couldn't be read, was taken as missing, so the step played with
Photoshop's default. A `setting` helper (as in steps_image.rs) now reads
a present key with its expected type and returns None otherwise, so the
step stays a Photoshop step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:58:46 -06:00
yoriswind d55830de94 Preserve noncanonical Group F descriptor headers 2026-10-31 20:57:09 -07:00
Hector VillarrealandClaude Opus 5.5 63616a670a Actions: keep a Match Color or Trap step with a non-numeric setting (CodeRabbit review on crates/engine/src/cmd/atn_cmds/steps_channels.rs:88)
A present `Lght`, `ClrR`, `Fade` or Trap `Wdth` that isn't a number read
as missing, so the step played with Photoshop's default and saved back
with it. Each key now goes through `setting`, so such a step stays a
Photoshop step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:54:20 -06:00
Hector VillarrealandClaude Opus 5.5 fc88c45117 Actions: keep a Match Color step whose noReference isn't a Boolean (CodeRabbit review on crates/engine/src/cmd/atn_cmds/steps_channels.rs:88)
Only a Boolean false kept the step: any other non-Boolean value read as
missing, so the step played as a source-less Match Color and saved back
as `noReference` true. A `setting` helper (as in steps_image.rs) reads
the present key as a Boolean, and anything but true keeps the step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:53:01 -06:00
Hector VillarrealandClaude Opus 5.5 e5f810f2bb Tests: split_selected lifts min(a, k) and leaves max(a − k, 0) (FredApps review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:52:15 -06:00