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>
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>
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>
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.
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>
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.
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.
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.
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>
`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>
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>
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>
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>
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>
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>
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>
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.
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.
`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>
`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>
`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>
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>
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
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>
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>
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>
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>
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>
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>