Commit Graph
3891 Commits
Author SHA1 Message Date
92de311b2b Actions: keep more Blend If and Gradient Fill forms exact (#11249)
Review fix-ups on #11249 after merging main:
- A midpoint outside 5..95 %, transparency stops out of range or out of
  order, and a Gradient Fill Set without transparency stops stay
  reference-application steps instead of playing clamped or keeping the
  layer's own transparency.
- An inverted Blend If range stays a reference-application step; the
  command rejects it at play.
- The Layer Style dialog's OK records `Lefx` = {Scl} beside Blend If on a
  layer without effects (measured). That Set is still the dialog's one
  step and saves back with the `Lefx` it was recorded with.

Co-Authored-By: NaufalDzz <90562913+NaufalDzz@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 15:07:32 +01:00
David Mann 72645904c7 Merge remote-tracking branch 'origin/main' into pr-11249
# Conflicts:
#	crates/engine/src/cmd/atn_cmds/steps_make.rs
#	crates/engine/src/cmd/atn_cmds/tests.rs
#	docs/atn.md
2026-11-06 14:55:00 +01:00
David Mann 0b765b2fbe Merge PR #11005: Pen: Make Shape turns the path into a shape layer (#10934) 2026-11-06 14:53:39 +01:00
David MannandClaude Opus 5.5 4f124949b5 Address CodeRabbit review: convert type style colours with the type; keep Basic Paragraph on Duplicate to New
Converting a document (layer copy to another mode/profile, Image > Mode,
Convert to Profile with or without dither, Duotone inks) converted run colours
but not the colours set by character/paragraph styles and Basic Paragraph, so
converted runs showed a false local override and stopped following later
style edits. Duplicate Layer > New Document dropped the source's Basic
Paragraph, giving inheriting type false overrides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 14:20:31 +01:00
David MannandClaude Opus 5.5 1f1f42182b Address CodeRabbit review: keep the pattern-scale clamp out of previews
transform_fx::work_layer scales a style to the preview's work resolution
with scale_effects, so the 1..1000 % clamp turned a 2 % pattern at a
quarter of the size into 1 % instead of 0.5 %, and an imported 2000 %
pattern into 1000 % at full size. scale_effects_preview scales patterns
exactly; Scale Effects and Image Size's Scale Styles keep the clamp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 14:20:22 +01:00
David Mann a9a002e828 Merge remote-tracking branch 'origin/main' into HEAD 2026-11-06 14:05:39 +01:00
David Mann e8bb14bb0f Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/scorecard.md
#	docs/ui-parity.md
2026-11-06 14:05:34 +01:00
David Mann a0ae468a7b Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/engine/src/cmd/image_cmds.rs
2026-11-06 14:05:05 +01:00
David Mann e337259d67 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/engine/src/cmd/artboard_cmds.rs
2026-11-06 14:04:53 +01:00
David Mann a9de7ebee8 Merge remote-tracking branch 'origin/main' into HEAD 2026-11-06 14:03:38 +01:00
Trevor Brown 85295a48a8 Merge remote-tracking branch 'upstream/main' into feat/artboard-options-bar-11385
# Conflicts:
#	crates/ui-egui/src/lib.rs
#	crates/ui-egui/src/tools/artboard_tool.rs
2026-11-06 07:45:33 -05:00
Khawar Zamman Wani 1ce1bced95 PSD admission: a little free memory no longer refuses every file
With 1 GiB or less of free RAM, or 512 MiB or less of commit headroom, the
hard limit was exactly 0, so even a small file was refused with a message that
didn't say memory was low.

The reserve now shrinks with the measurement: up to a quarter of free RAM opens
automatically, the rest goes to approval, and an approved import always leaves
at least 256 MiB free. Limits are unchanged for automatic opening above 4/3 GiB
free and for approval from 4 GiB free. A refusal set by measured memory now
gives the free amount and says to close other apps and try again, and the
approval prompt warns when little memory would be left.

An unreadable cgroup still measures Some(0) and stays refused.
2026-11-06 17:03:50 +05:30
Khawar Zamman WaniandClaude ed49cd9401 Scratch free space is asked of the folder itself, so network folders report their own numbers
Windows network folders reported unknown because sysinfo doesn't list them, and an unlisted Linux
NFS or CIFS mount used the numbers of its listed parent. GetDiskFreeSpaceEx (Windows) and statvfs
(Unix) on the directory fix both. macOS keeps sysinfo's figure, which counts purgeable space, when
the listed disk is this volume. A mount that reports no space is flagged in Preferences, in the
hard-limit refusal and in spill::stats, with a hint to set a Scratch Size Limit or use a local disk.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-06 14:58:27 +05:30
Khawar Zamman Wani 02c5ea8e68 Merge commit '349a03b6b18b0bcee64090f6faa9fc321960fc34' into claude/brave-wu-261567 2026-11-06 14:54:08 +05:30
David Mann ec5eb1e2d0 Merge commit 'refs/fixprs/main' into HEAD 2026-11-06 10:21:59 +01:00
David Mann 519d29c536 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/scorecard.md
2026-11-06 10:10:32 +01:00
David Mann 7271c8cca7 Merge pull request #3634 from davidmann4/feat/history-snapshot-options
History Options: Automatically Create First Snapshot, New Snapshot When Saving, Show New Snapshot Dialog by Default (#2966)
2026-11-06 10:07:19 +01:00
Khawar Zamman Wani 349a03b6b1 Refusal text states the lower limit, links the download and shows readable sizes
The 32-bit message ended mid-phrase. It now says the cap applies or less if
less memory is free, and separates the cause from the next step. Windows
scratch tests check the returned numbers belong to the temp directory's volume.
2026-11-06 14:01:03 +05:30
Khawar Zamman Wani 1eb3218a4b Merge remote-tracking branch 'origin/main' into claude/investigate-issue-e27e90 2026-11-06 12:37:29 +05:30
Khawar Zamman Wani 390b3b388a Replace params for every adjustment smart filter dialog and Shape Blur
Color Lookup uses the schema dialog, which removes an emptied text key, so
a stale data or file was read over the chosen lut. Key the replacement on
image.adjustments.* rather than the dedicated editors. setParams' replace
now also holds for Shape Blur, which merged before resolving its shape.
2026-11-06 12:01:12 +05:30
Khawar Zamman Wani 2e13ec280b Replace an adjustment smart filter's params when its dialog edits them
layer.smartFilter.setParams merges, so a key the dialog removed stayed
stored. A Channel Mixer filter with Monochrome turned off kept its gray
row, which is read over red: the Red sliders had no effect. The dialog
holds all of an adjustment's settings, so it now passes replace: true;
other callers keep merging.
2026-11-06 11:52:38 +05:30
yoriswind 145747962a Keep Actions control playback headless and preserve ATN imports 2026-11-05 22:14:49 -08:00
Hector VillarrealandClaude Opus 5.5 4fae869018 Masks: a recorded mask drop replays on another document (CodeRabbit review on cmd.rs:815)
The journal made `layer` portable for layer.layerMask.moveTo but kept `to` as
the document's layer id. Replayed on another document, that id names some
other layer or none: the mask silently went to an unrelated layer or the step
failed. Before the fix, recorded_mask_drop_replays_on_another_document
recorded `"to": 8` and replay moved the mask onto "Extra" instead of "Shadow".

Recording now keeps `to` as the layer's name (from the document before the
step, since a drop on the Background renames it "Layer 0"), plus
`toOccurrence` when several layers share the name. move_mask resolves a name
(requiring `toOccurrence` when it is ambiguous), and explicit calls still take
a numeric id. This matches how layer.moveTo records its drop target
(`target` + `targetOccurrence`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 22:33:42 -06:00
Hector VillarrealandClaude Opus 5.5 1fd0ec7a61 Save for Web: refuse slice numbers with a whole-image path and a null slices (CodeRabbit review on crates/engine/src/cmd/web_cmds/save_web.rs:211)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 22:05:35 -06:00
Hector VillarrealandClaude Opus 5.5 f1427bba65 Save for Web: refuse slice numbers with a whole-image path (CodeRabbit review on crates/engine/src/cmd/web_cmds/save_web.rs:237)
`path` alone writes the whole image as one file, so slice `numbers` with
it were ignored. It is refused; `dir` exports the chosen slices. Main's
`folder` destination (#5305) is the whole image too, so `folder` alone
with `numbers` on a document with slices is refused the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 22:05:34 -06:00
Hector VillarrealandClaude Opus 5.5 8a1e58ee41 Save for Web: refuse unknown Slices choices (FredApps review)
The engine read `slices` loosely: any value but "user", including the
dialog's "selected" and a typo, exported every slice when `numbers` was
absent. `slices` is now all, user or selected (documented in the
command's parameters), anything else is refused, and Selected Slices
without `numbers` on a document with slices is refused as the dialog
already does ("No slices are selected"). A document without slices
still exports the whole image whatever the choice, as the dialog sends
it then.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 22:05:34 -06:00
Hector VillarrealandClaude Opus 5.5 93831e9715 Save for Web: refuse slice numbers that don't exist (FredApps review)
A `numbers` entry naming no slice was dropped, so an export of only
missing numbers succeeded with no files, an HTML page of empty cells,
and remembered settings. Photoshop's dialog can only select slices it
shows, and ours builds `numbers` from the slices it draws, so any number
that doesn't exist (or isn't a slice number at all) now refuses the
whole export, naming the missing numbers. The check runs with the
settings, before a floating move is committed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 22:05:34 -06:00
Hector VillarrealandClaude Opus 5.5 cd1ac9c0e1 Save for Web: keep unexported slices as empty HTML cells (CodeRabbit review on crates/ui-egui/src/dialogs/file_ui/web.rs:569)
With HTML on, the table was built from the exported slices only, so
exporting the right of two slices (Selected Slices, or All User Slices
dropping an auto slice) moved its image to the first column. Every
resolved slice now keeps its grid position; the ones not exported are
empty cells.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 22:05:34 -06:00
Hector VillarrealandClaude Opus 5.5 f57bcddbb5 engine: test mask drops on the mask's own layer and undo after a copy or replace (FredApps review)
Dropping a mask on its own layer (any copy/replace combination) is refused and leaves the mask's
pixels, enabled state and density, the document and the history as they were. One undo after an
⌥-copy, an ⌥-copy that replaces, or a move that replaces puts both layers' masks back exactly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:54:45 -06:00
Hector VillarrealandClaude Opus 5.5 84696c3b03 engine: check a replaced layer mask's content in the mask move test (CodeRabbit review on crates/engine/src/cmd/ops.rs:224)
The group now has a mask of its own, unlike the source's, before the replacing move, and the
test checks the group ends up with the source's mask, so a replacement that does nothing fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:54:45 -06:00
Hector VillarrealandClaude Opus 5.5 911aa4dede Drag a layer mask onto another layer or group to move it, ⌥ to copy it (#10485)
In Photoshop, dragging a layer mask's thumbnail onto another layer or group moves the mask
there, and ⌥-dragging copies it. PhotoCraft's mask thumbnails could only be dragged to the
trash, so dropping one on a group did nothing.

- engine: layer.layerMask.moveTo {layer, to, copy, replace}: one history step; a layer
  that already has a mask keeps it unless `replace`; the Background becomes a layer first.
- Layers panel: a layer mask thumbnail dropped on another row (layer or group, without a
  mask of its own) moves the mask there, ⌥ copies it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:54:45 -06:00
Saloouu 633201a72b Merge main 2026-11-06 04:45:27 +01:00
Khawar Zamman Wani 7c2127b6bc PNG import in steps: stream the rows into tiles, turn upright in bands
PngImport decoded the whole image and then copied it into a second, tile surface (about
+400 MB for a 100 MP RGBA8 file, enough to kill a browser tab). A PNG whose rows come in
final order now streams: PngDecodeRows::step_stream hands each group of rows on, they
become tiles at once (the PngStream the one-shot streamed import also uses) and are
dropped, then the prune scan runs in batches. decode_rows is the same step_stream driven
to the end, so there is one path. Interlaced, animated and early-eXIf-oriented files are
decoded whole as before; a late eXIf sends a streamed import back to a whole decode.

The turn upright of an EXIF orientation 2-8 was one whole-buffer pass in the poll of the
last rows; OrientSteps (photocraft-codecs) does it in bands of 64 rows through the same
band writer as Image::oriented, and PngImport runs it as a stage of its own.

Memory-budget errors keep their type and text: the stream is checked as the one-shot
streamed import is, and, like the whole-image path, a layer under 32 MiB is not.
Docs for the stepped place updated.
2026-11-06 09:13:41 +05:30
Khawar Zamman Wani 6ebc4c96f8 Place: move the pixels a few tiles at a time, name the real place command in the size error
A place at an offset off the tile grid rebuilt nearly every tile the image touches in
a single poll, which can overrun the ~8 ms slice on a big image. TranslateSteps
(photocraft-raster) builds the target tiles of Surface::translated a tile at a time
with the same code (a shared ShiftBuilder), so the result is bit-identical; the place
runs it as a Placing stage of its own in a cooperative session.

The flatten size refusal named "file.place", which is no command: it now names
file.placeEmbedded or file.placeLinked.
2026-11-06 09:13:41 +05:30
Hector VillarrealandClaude Opus 5.5 3c97ed53c4 Guides: test arithmetic in Edit Selected Guides (indy2kro review on edit_cmds.rs guide_position)
`view.editGuide` reads its position through `guide_position` too, so it
takes the same arithmetic as New Guide. Cover the command (including a
turned guide, whose % is of the new extent) and the Edit Selected
Guides dialog, where a leading bare number is in the ruler unit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:23:15 -06:00
Hector VillarrealandClaude Opus 5.5 d2b3615db7 Guides: cap a guide position's arithmetic at 1024 bytes (indy2kro review on prefs.rs eval_length)
`Unit::eval_length` refuses text over 1024 bytes before tokenising it,
the same cap as the numeric fields' evaluator, so the operand and
operator lists it builds stay bounded (AGENTS.md: cap allocations sized
by input).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:23:15 -06:00
Hector VillarrealandClaude Opus 5.5 729045c35b Guides: read the Unicode minus in a guide position (indy2kro review on prefs.rs eval_length)
`Unit::eval_length` and the New Guide dialog now take `−` (U+2212) as a
minus, as the numeric fields' own evaluator does. In the dialog it also
lets a leading bare number get the ruler unit before a `−`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:23:15 -06:00
Hector VillarrealandClaude Opus 5.5 da7f83e1cc New Guide takes arithmetic in its position, as in Photoshop (#10440)
The position took one length; Photoshop's field evaluates + - * / over mixed
units ("100% / 3", "100% - 50px", "1in + 10"). Unit::eval_length does that
for view.newGuide / view.moveGuide: * and / bind tighter, a bare number added
or subtracted takes the first operand's unit (as Photoshop's "1in + 10" is
11 in), a bare multiplier is a number. New Guide's dialog gives a leading bare
number the ruler unit, as it does a lone one.

Fixes #10440

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:23:15 -06:00
Khawar Zamman Wani 123b2032c4 Web build: Place runs a slice per frame, so a large PNG no longer freezes the page (#10164, rebased onto main)
The remaining commits of the stack, applied on top of the squash-merged #10147:

- PNG decodes in resumable steps of rows (PngDecodeRows, shared with decode_rows)
- PNG imports as a document in resumable steps (io PngImport, text metadata and
  document build in bounded steps)
- Jobs can run a slice at a time where there are no threads (StepWork,
  cooperative sessions, Session::poll_jobs)
- Place decodes, flattens and resizes in slices (PlaceSteps), reading a path
  and keeping the frame, memory gate and typed memory-budget errors main has
- The web build places dropped and picked files a slice per frame, with a
  bounded place inbox
- A measurement of the stepped place; docs for jobs without threads
2026-11-06 08:51:17 +05:30
Hector VillarrealandClaude Opus 5.5 be4a915161 Replace Color: Lab bounds refuse subtracted samples; panic_hunt covers them (tanish2k09 review)
Main's Lab bounds (#10765) refuse RGB samples, subtractPoints and order
included. A test pins that for subtractPoints and order, and panic_hunt
now sends malformed and far-off subtractPoints, points and click orders,
also with Lab bounds, to every command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:15:00 -06:00
Hector VillarrealandClaude Opus 5.5 dd07d15aa3 Replace Color: check the unsampled black with a lifting pass (CodeRabbit review on tests.rs:888)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:15:00 -06:00
Hector VillarrealandClaude Opus 5.5 01c825b693 Replace Color: test a partly covered colour blends by its coverage (CodeRabbit review on crates/engine/src/cmd/adjust_cmds/tests.rs:898)
The several-samples test only checked pixels the samples cover fully or not
at all, so thresholding the coverage at 0.5 passed it. A lighter red at the
edge is covered about 0.45 by Select > Color Range for the same clicks;
Replace Color must give the blend of its colour and its fully replaced
colour at that coverage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:15:00 -06:00
Hector VillarrealandClaude Opus 5.5 647a177428 Replace Color: test an interleaved click order against Color Range (CodeRabbit review on crates/engine/src/cmd/adjust_cmds/tests.rs:846)
Every test with `order` used the default grouping (all additions first), so
dropping `order` from the keys forwarded to the Color Range matcher failed
none. `+ - +` on the grey strips subtracts while the box is the dark grey
alone, so the light grey added after it is matched; the test checks Replace
Color changes exactly what Select > Color Range covers for those clicks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:15:00 -06:00
Hector VillarrealandClaude Opus 5.5 d2deecca21 Replace Color: check undo restores every pixel with several samples (FredApps review)
The multi-sample test undid without looking at the result. It now
compares the whole layer with the pixels from before, after two added
samples and after an added and a subtracted one. Applying the edit as
two history steps makes it fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:15:00 -06:00
Hector VillarrealandClaude Opus 5.5 53646b796f Replace Color: test Localized Color Clusters with several samples (FredApps review)
Two creams sampled in two places with Range 20 %: each is replaced near
its sample, the same cream far from both is left alone, and Select ›
Color Range covers the same pixels. Not forwarding `localized` to the
multi-sample matcher makes it fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:15:00 -06:00
Hector VillarrealandClaude Opus 5.5 4ff73834bc Replace Color: test a subtraction inside the added range (FredApps review)
The subtraction checks subtracted a blue that never matched the red
sample at fuzziness 40, so "blue stays" held with or without
`subtractPoints`. The new test adds a dark and a light grey and subtracts
a grey near the light end: as in Photoshop the light edge of the Lab box
moves onto the subtracted grey, so the light grey is no longer replaced,
and Select › Color Range agrees. Ignoring `subtractPoints` makes it
fail. The old checks now say why blue stays, and a doc comment that sat
on the wrong test is moved back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:15:00 -06:00
Hector VillarrealandClaude Opus 5.5 627afeda1c Replace Color: forward the resolved From colour to the subtract-only matcher (CodeRabbit review on adjust_cmds.rs:427)
Test: replace_color_subtract_only_reads_a_null_colour_as_the_foreground.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:15:00 -06:00
Hector VillarrealandClaude Opus 5.5 ebcc2b5e91 Replace Color: subtract-only samples start from the From colour (CodeRabbit follow-up on adjust_cmds.rs:418-425)
Test: replace_color_subtract_only_starts_from_the_from_colour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:15:00 -06:00
Hector VillarrealandClaude Opus 5.5 90f9d0e07d Replace Color: refuse a malformed subtractPoints with one sample (CodeRabbit review on crates/engine/src/cmd/adjust_cmds.rs:414)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:15:00 -06:00
Hector VillarrealandClaude Opus 5.5 099195e978 cargo fmt (CI gate failed on formatting)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:15:00 -06:00