* 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)
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
`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>
`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>
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>
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>
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>