* 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)
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 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>
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>
- The supported table read the command list of the next entry for an event whose
list is a constant: Filter Gallery (`GEfc`) maps to `filter.gallery.spatter`, not
Shadows/Highlights. The table now resolves constants and reads each entry alone.
- Steps measured in a prepared document (Fade, Replace Color, Trap, selection
combinations, ...) show the example values that were sent, labelled as such, not
as factory defaults.
- Mosaic cell size: write `#Pxl`, read a value without a unit as pixels.
- Custom: no factory matrix; the test matrix is no longer shown as defaults.
- Intro: kept steps with no document effect are imported switched off and skipped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/atn.md lists the 117 events PhotoCraft maps today and, for 101 events it does
not map yet, every key the step carries in recorded order, with type, unit, factory
default, exact range and accepted enum values, measured in the reference application.
An implementation needs no further checks there. Linked from file-format-parity.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Some lossy type 2 NEFs store a split row at byte 562 of maker note 0x0096.
They were refused ("lossy after split") and opened as the camera's preview.
The 11 such CC0 raw.pixls.us files come from the D3400, D5, D5000, D5200,
D5500, D5600, D7000, Nikon 1 J5 and Z 6_2.
Decode them following the rule LightCraft derived by black-box analysis of
those 11 files (storytold/lightcraft#633), the same route the Huffman tables
took. Rows above the split are Huffman coded as before. From the split row on,
every pixel is one MSB-first word of bits - 4 bits: a prefix code for the
difference category followed by the top bits of the T.81 additional bits,
dequantised to the centre of the kept bin (fixed_words, ported from
LightCraft's fixed_word_table), with the same predictor and an unclamped
running value. The section ends the strip: whole rows (up to 4 more than the
image), then 0-7 one-bits.
A split file that fails to decode for any reason (a section that does not end
the strip, the all-ones word, truncation, size limits, a split row past the
image, a curve long enough to cover byte 562) stays unsupported, so it keeps
the embedded-preview fallback it had before. Apart from the all-ones word and
the padding, the content of the fixed-rate section is not validated: a damaged
word inside a well-formed section decodes without an error, as in LightCraft.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#4985 added a canvas Shift+right-click popup that worked only for the
Brush and listed only its painting modes. In the reference application
Shift+right-click opens a menu for every painting tool: Edit Brush…
(the Brush Preset picker a plain right-click opens), a separator, then
the tool's own Mode list from its options bar:
- Brush, Pencil: the painting modes with Behind and Clear
- Clone Stamp, Pattern Stamp, History Brush: the blend modes
- Mixer Brush, Color Replacement, Background Eraser: Edit Brush… only
- Eraser: Brush / Pencil / Block (no Edit Brush…)
- Blur, Sharpen, Smudge: Edit Brush… (the reference lists modes too)
- Dodge, Burn: Shadows / Midtones / Highlights; Sponge: Desaturate /
Saturate
- Healing Brush: its blend modes; Gradient: the blend modes; Paint
Bucket: the blend modes with Clear (no Edit Brush…)
- Spot Healing, Magic Eraser and non-painting tools: no menu, the
gesture keeps its old route
brush_mode_menu.rs is now a per-tool item list (Item enum + items(tool))
instead of a Brush-only list. Each row sets exactly what the tool's
options-bar control sets: a brush-based tool's mode through
tools.setBrush (Brush/Pencil also Behind and their own Clear flag), the
Eraser mode, tone range, sponge mode, gradient and bucket modes as tool
options. Blend modes are grouped with separators; the current choice is
checked; Behind and Clear are greyed on the Background layer. The menu
remembers the tool that opened it and closes on a tool change.
Only settings the options bar already has are offered. Not offered yet
(no setting here): Behind for the stamps, History Brush, Gradient and
Paint Bucket; the Blur/Sharpen/Smudge modes; the Spot Healing modes;
the Healing Brush's Sampled/Pattern source and Replace; the History
Brush source.
Control: ui.inspect's brushModeMenu reports tool, mode, choices (the
active tool's labels) and items (label/enabled/checked, separators);
ui.context.choose {id: <label>} picks a row, an unknown or greyed row
is an error that changes nothing.
Tests (kittest): each representative tool's rows in order, choosing a
row sets the options-bar state and journal, Edit Brush… opens the
picker at the click, Behind/Clear greyed on the Background, Magic
Eraser and Spot Healing open nothing; control graceful failure for bad
choices. "Edit Brush…" added to every catalog.
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.
The swatches that now open the full Color Picker changed only on OK, so Photo Filter, B&W Tint,
Gradient Map stops (Properties and Image > Adjustments), the Content-Aware Fill and Select and Mask
overlays, Neon Glow and Save for Web lost the live preview main's popup had. The open picker now
previews its colour on the swatch every frame, Cancel (or OK unchanged) restores the exact opening
value (bit-exact for linear floats), and the Properties panel commits one history step when the
picker closes. A picker closed without OK or a preview changes nothing (a Gradient Map stop at a
PSD's 1229/4096 kept its location on Cancel).
With no document open, the options-bar popover's Color Picker refused OK ("no document open")
before reaching the tool-only path; it now sets the next shape's colour as on main.
A popover swatch the shape refused (a job holding the document) still joined Recently Used Colors;
it now joins only after the edit succeeds. Adds a CAF keys test for an open widget picker, and
fixes the ui-parity date and count the main merge set back.
Co-authored-by: SimoneRecchia <201361065+SimoneRecchia@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#6236 made Escape put back the colour the gesture started from. In the
reference application Escape while the right button is held closes the
HUD and keeps the colour picked so far; moving the pointer afterwards
changes nothing (measured: picked 0,40,96 from 40,90,160; after Esc and
a further move it stayed 0,40,96, also after the release).
Escape now ends the gesture like the button release does. The pick is
still one coalesced history step, so Undo takes it back.
Test: Escape closes the HUD with the picked colour kept, a later move
picks nothing, and releasing the button afterwards opens nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#6236 drew the hue strip left of the saturation/value square and opened
the HUD just below the press point. In the reference application the
square is on the left with the hue strip to its right, and the HUD opens
so the colour you start from sits under the pointer: pressing without
moving changes nothing, and a small move nudges the colour from there.
The HUD now uses that layout and placement (still pulled in to stay on
screen near an edge). The rects come from one `layout` function, shared
by drawing, hit-testing and the tests.
Tests: the square is left of the strip and the starting colour's spot is
under the pointer; a mid colour opens with the pointer inside the square
and picks nothing until it moves; near the bottom-right corner the HUD
stays on screen and the press alone picks nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#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).
748 upstream commits: append-only conflicts (i18n, ui-parity, people.toml,
the tools module lists) keep both sides. Scorecard: 12 of 183 settings do
nothing; docs/ui-parity.md follows it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TYsCL5E2GM6hUabP9dmYAv
docs/target-app-parity.md status line: main's newest (2026-10-27) plus the Japanese paper-size clause at its previous position; both tables kept main's rows.