`image.trap` accepts any width, and `trap_to` wrote it straight to
`Wdth`, so a step above the 32767 px the import clamps to saved a value
Photoshop doesn't take. Like other out-of-range exports (fields.rs,
#7287), it now refuses the step rather than clamping it to another width.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A present enumeration key of another type, or a Custom `Scl `/`Ofst`
that isn't a number, was read as missing and 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. It also reads `Scl` without its padding, which the key
gate already admitted but the mapper read as the default 1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Filter Gallery steps (GEfc with the effect in GEfk, or the effect's own
event) map every effect to filter.gallery.<effect>, not only Spatter:
each key in recorded order, out-of-range values clamped and missing
keys given Photoshop's defaults, enumerations, Invert and Neon Glow's
colour mapped both ways. The table is generated from the event
reference's Group A; every integer range and default matches the
effects'. Glass maps the Frosted and Canvas textures the reference
gives codes for. A setting the event cannot hold refuses the step.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
De-Interlace (Dntr), NTSC Colors (NTSC), HSB/HSL (HsbP), Custom (Cstm),
Average (Avrg) and Remove Black / White Matte (RmvB/RmvW) load as their
commands, play, and save back with the same keys. Missing keys take
Photoshop's defaults; a Custom matrix that is not 5 x 5 keeps the
Photoshop step. Replace Color and the direct Gradient Map (GrMp) are
still kept verbatim.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The enum and Boolean gates passed a present key of another type, and
the amount and radius fell back to their defaults. The key gate admits
`Rds` without its padding, but the radius was read as `Rds ` only, so it
played as 1. Every key now goes through `setting`, which reads the key
as the gate admits it and keeps a wrong-typed step as a Photoshop step.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A present lightingOn or numeric key of another type passed the key-name
gate, read as missing and played with Photoshop's default. Each key now
goes through `setting`, so such a step stays a Photoshop step.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A wrong-typed sampleAllLayers was read as missing and the step played
with false. A shared `setting` helper now reads a present key with its
expected type and returns None otherwise, so the step stays a Photoshop
step, like settings the command can't represent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Split Channels (SplC), Merge Spot Channel (MSpt), Trap (Trap) and Match
Color without a source (matchColor, noReference) load as channel.split,
channel.mergeSpot, image.trap and image.adjustments.matchColor and save
back with the keys Photoshop records. The split's recorded documentIDs
belong to its run and are neither replayed nor written; Trap's width is
clamped to 32767 px; Match Color takes Photoshop's defaults. Steps the
events cannot carry (a split keeping its original, a named spot
channel, a Match Color source or option) are refused on export.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pinch, Polar Coordinates, Spherize, Twirl, Wave and ZigZag steps load
as filter.distort.*, play, and save back with every key in recorded
order. Out-of-range values are clamped as Photoshop clamps them and
missing keys take Photoshop's defaults (Wave's undefined areas are
Repeat Edge Pixels). A Wave scaled below 100 % stays a Photoshop step,
as the command has no scale. Shear is still kept verbatim: its curve
points need a step recorded through its dialog.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Oil Paint (oilPaint), Smart Sharpen (smartSharpen), Focus Area
(focusMask), Select Sky (selectSky) and Remove Background
(removeBackground), recorded by string ID, load as their commands and
save back with the keys and defaults Photoshop records. Oil Paint's and
Select Sky's Photoshop defaults are written out where they differ from
the commands'. Smart Sharpen maps the legacy Lens Blur form with no
noise reduction; other forms stay Photoshop steps. Settings the events
cannot carry refuse the step on export.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Transforming a selection split each pixel as a·k and a·(1 − k), so a
selection loaded from the layer's own transparency (⌘-click) left a
faint ghost of its anti-aliased edge behind. Move already lifts up to the
pixel's coverage (min(a, k), leaving max(a − k, 0)); split_selected now
does the same, for Free Transform, its live preview, Warp and Distort.
An opaque pixel still splits as k and 1 − k.
Fixes#5595
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The author's main merge brings one new test (full coverage keeps Threshold over
extreme float channels) and rewords the #9483 tone comment; its main side
(b1cfff9d3) is already in the batch. Docs keep the batch's newer status lines and
revision rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Channel targeting routes an allow-list of pixel-editing paint commands, not every
`paint.*` id: the Mixer Brush's Alt-click load and Symmetry no longer follow a colour
set or get refused with "Rasterize the layer" on a fill layer. Patch and Content-Aware
Move stay routed (#9274).
- Native vector save-back checks the preview SVG as strictly as stored previews are
checked on load and PSD export, so a preview with an unreadable embedded image is
refused instead of stored and later dropped (#8571).
- .pcraft blobs read their zstd frame with framing headroom, so an incompressible
preview right at its 16 MiB limit still loads; the limit still bounds the data.
- Levels/Curves recall (Alt+shortcut) decides the combined Lab record from the target
the dialog captured, as remembering does, so a viewed layer mask keeps its settings
beside a Lab colour set (#9274).
Each comes with a test that fails without it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reference application, measured with Duplicate Layer from 72 to 300
ppi: a character or paragraph style the destination lacks arrives under
its name with its sizes scaled like the text (24 pt -> 5.76 pt), so the
copy has no override; a destination style of the same name keeps its
definition and the copy shows an override (+).
Copies never brought styles before: a copied run kept the source's style
id, which in the destination named another style or none. Copy to
Document, Paste and Duplicate Layer > New Document now match styles by
name, add the missing ones under fresh ids and point the runs at them;
retarget_type_resolution scales the point values of the styles that
travel with the copies.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After moving selected pixels, the selection is the moved pixels' alpha
(#7538, measured in Photoshop). Free Transform split the layer by
multiplying the selection into each pixel, so a soft edge pixel of
alpha a was lifted as a² and a × (1 − a) of it stayed behind: a grey
outline of the shape at its old place.
`split_selected` now lifts the selection's share of each pixel's
coverage, up to all of it, as moving selected pixels already does
(`float_cmds::cut_piece`, #7655). Opaque pixels still split as k and
1 − k, and fully selected pixels move whole, as before. Warp, Distort
and the live transform preview share the function.
Photoshop's Actions panel has a folder button and a New Set… menu item that make an
empty action set (default "Set 1"); New Action lands in the selected set. PhotoCraft
showed sets from Load Actions but couldn't make one.
- actions.newSet: an empty set (default "Set N"), kept for the session until it
holds an action; actions.record takes a `set` for the new action.
- Actions panel: the folder button and New Set… open a name dialog; empty sets show
as folder rows; a click on a folder row selects it; New Action records into the
selected action's set, else the selected set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Photoshop opens the Stroke dialog for a Stroke descriptor without its blend
mode, even with dialogs off, so an exported action stopped there. stroke_to
now writes edit.stroke's defaults for location (center), opacity (100),
mode (Normal) and preserveTransparency (false) when the step leaves them out,
as Photoshop's own recorded Stroke carries them all.
Fixes#8303
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
layer.setAdjustment changes only the settings it names, but the Levels
descriptor writes each range whole and fills the end an edit did not name
with 0 or 255. A recorded {"kind":"levels","inBlack":31} was exported as
Inpt [31, 255] with nothing skipped, so replaying it also reset a retained
Input White. This is the Levels half of #8701 (Color Balance and
Hue/Saturation, #8531).
levels_complete accepts a Levels edit only when, for the master curve and
every channel object, inBlack/inWhite are both given or both absent, and
likewise outBlack/outWhite. set_to uses it as the levels arm of the
existing completeness check, so strict export refuses the step and a
non-strict export lists it as skipped.
Test partial_levels_edits_refuse_strict_export fails without the fix (the
export succeeds with Inpt [31, 255]) and passes with it.
Fixes#8530
Export As, Quick Export and Save for Web now start in the folder of the
last successful export (new preference export.lastFolder, kept across
restarts), falling back to the document's folder when none is remembered
or the folder is gone. Save As and non-export save dialogs are unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
#4035's only code change makes Rasterize Layer Style separate its RGB bake
through the document's own CMYK profile, but none of its tests ran that
command (they cover Flatten, Stamp and Merge, which already worked), so
removing the change left every test green.
New test: a tagged CMYK document's layer gets a drop shadow that falls off
the canvas and is rasterized; the inks must come back within the profile's
round trip. Without #4035's change they move by 35 levels (0.137) and the
test fails; with it they pass at 8 and 16 bits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reference application's Liquify has Twirl Clockwise only; holding
Alt (Option on macOS) while using it twirls counterclockwise. PhotoCraft
had an extra Twirl Counterclockwise tool on the strip, and #9598 had just
given it a mirrored icon.
Twirl Counterclockwise leaves the tool strip (LiquifyTool::ALL, 11 to
10 tools) and the rotate-ccw icon #9598 added goes with it (asset,
icon_data entry, ATTRIBUTION count back to 113). Alt already reversed
Twirl Clockwise at stroke-down; that stays. The TwirlCcw variant stays as
a stroke's direction: Alt-strokes record `twirlCcw`, and filter.liquify
strokes and older saved strokes naming it still replay as Twirl
Clockwise reversed (the command doc says so). Selecting it as the tool
(control channel `tool: "twirlCcw"`, or a preference saved by an older
version) is refused with an error that says to choose twirlCw and hold
Alt; the rest of the settings still apply and the dialog opens.
Tests: the_tool_strip_has_no_twirl_counterclockwise (no such tool, label
or missing icon on the strip, C is Twirl Clockwise, `twirlCcw` as the
tool is an Err and leaves the tool, an old saved preference naming it
opens); alt_with_twirl_clockwise_twirls_counterclockwise (the field
displacement a dab leaves right of the centre points up without Alt and
down, mirrored, with Alt). twirl_counterclockwise_has_its_own_mirrored_icon
and the twirlCcw row of alt_reverses_twirl_and_swaps_pucker_and_bloat
are removed. The i18n labels for Twirl Counterclockwise stay (the
variant's label).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#9594 fixed type copied between documents of different resolutions
re-laying out at the wrong size on its next edit by running the Image
Size resolution step on the copies: the type kept its point size
(24 pt) and got a compensating transform of src/dst ppi, with box and
path text scaled up to match.
The reference application, measured by script, keeps the pixels and
rewrites the point size instead: 24 pt copied from a 72 ppi document
into a 300 ppi one becomes 5.76 pt (24 x 72/300), and 24 pt from
300 ppi into 72 ppi becomes 100 pt. There is no transform, the
Character panel shows the rewritten size, and later edits keep it.
adapt_copies, which both Copy Layers to Document (Duplicate Layer to
another document, dragging layers between documents) and Paste of a
copied layer go through, now calls canvas_geom::retarget_type_resolution:
every size in points is multiplied by src/dst ppi (font size, leading,
baseline shift, first-line/start/end indents, space before/after) and
the PSD TySh is rebuilt. Box, path and transform are in pixels and stay
as they were; tracking, kerning and auto leading are relative to the
size and stay too. A resolution that isn't a positive number counts as
72 ppi (what the text engine lays it out at), and the scaled sizes stay
finite and above zero. Image Size keeps its own behaviour.
Tests: copy and Paste in Place, 72->300 (5.76 pt) and 300->72 (100 pt):
leading, baseline shift and indent scale, tracking stays, no transform,
the same ink bounds as the source, and after an edit the size is kept
and bounds and coverage match the source's render. Paragraph text keeps
its box and wrapping. Bad and absurd resolutions don't panic or produce
non-finite sizes. The #9594 test is replaced by these.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The doc.save row, docs/development.md, the MCP doc_save description, the
file.saveACopy params text, the --pcraft-full-composite help and the
option's doc comments said the option writes composite/full.png. A save
leaves it out when the canvas is past 2^26 pixels, when its pixels cannot
be allocated or encoded, or when a ZIP bundle would pass its limits. They
now say so and point to the manifest's full_composite member, which names
the entry when it was written.
#5176 made ±100% move the edge by max(radius, feather, 2σ smooth), at
least 1 px. Measured in the reference application (a 100 px square,
Radius/Feather/Smooth each varied, Shift Edge -100/-50/+100):
- A hard selection does not move at all, at any Shift Edge.
- On a feathered edge the result is a fixed per-pixel curve, the same at
2, 5 and 10 px feather: the pixel's odds a/(1-a) are multiplied by
49^(shift/100). At -100% a 50% pixel becomes 2%, at -50% 1/8, at
+100% 98%. The fit holds within ±0.05 in log-odds on every sample.
So Shift Edge is now that curve, applied last as before. It needs no
neighbours, so the morphology callback and the halo/spread it added are
gone, with the ignored benchmark that timed it (matting::morph itself
stays for Select › Modify and the mask view).
Tests: a hard edge is unchanged at ±50/±100%; seven measured
before→after coverage pairs; a feathered edge is pulled in; the engine
refine tests now check the hard edge stays and a feathered one moves.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts resolved as unions of both sides: codecs re-exports (PngRows + TiffBands), smart_cmds source imports
(main's source_surface_from_buffer and cache API with #8571's svg_source_image_in/convert_svg_source; main's
duplicate rendering import dropped), io flat.rs test modules (#8536's banded TIFF tests and main's PNG ones),
menus/invoke.rs (#8571's smart SVG intercept and main's layer.selectUnderCursor), state.rs (#8311's
type_box_overflow and main's type_insertion_style), the canvas_geom test keeps the is_finite guard, docs
status lines keep both change lists, i18n catalogs keep both sides' rows (hi.tsv: main's wording where both
added the same string).
Integrate main b1cfff9d3, preserving both canvas and Curves test suites and progress-document updates. Match the fused channel-selection blend to main's HDR-safe formula and cover full-coverage edits over extreme float values.