Commit Graph
3891 Commits
Author SHA1 Message Date
David Mann 320d285e1a Merge pull request #9887 from Firstbober/feat/indexed-color-matte
feat: add Indexed Color Matte options
2026-11-08 12:20:27 +01:00
SBaksa c2f85a590f Plug-in names: store the name trimmed, count U+2800 and unassigned ignorables as blank
A manifest name such as "\nTone" was checked trimmed but shown as given, so a line break reached
the menu; padding also got past the 64-character limit. The name is now stored trimmed.
The blank Braille pattern and the unassigned default-ignorable ranges no longer count as visible,
in plug-in names and History names. Applying a patch no longer takes the selection icon, and the
History source column has its doc comment back.
2026-11-08 19:59:43 +11:00
SBaksa be7ebc078a Lasso: refuse a history name that shows nothing or hides formatting
A historyName of zero-width, filler or BOM characters showed an empty History
row, and a bidi control or line separator could make a row read differently
from its name. A history name now has no control or line-break character
anywhere, loses white space and ZWNJ/ZWJ at its ends, and is then held to the
plug-in menu-label rule, now shared as
photocraft_plugins::manifest::printable_name (1-64 characters with a visible
one, no hidden format characters; plug-in names also refuse U+2028/U+2029).
2026-11-08 17:55:02 +11:00
Hector Villarreal 8272e6b9f4 Mixer Brush: refuse Indexed Color and Bitmap documents with the alert (#11958)
A Mixer Brush stroke in an Indexed Color or Bitmap document now fails before
anything is painted, with the reference's alert texts (convert to RGB Color /
Grayscale mode to edit); paint.mixerBrush returns that error and leaves the
document and History unchanged. A press on the canvas shows it as an Error
alert instead of a status-bar message. RGB, CMYK, Lab and Grayscale still
paint.
2026-11-08 00:28:08 -06:00
yoriswind 204588fe95 Keep unmeasured Displace menu steps opaque 2026-11-07 21:59:57 -08:00
Trevor BrownandClaude Sonnet 5.5 4f629dc4dd Patch: in Destination mode the selection moves with the patch (#12119)
A plain rectangular selection is translated by the drag offset in the same history state as the pixel change. Source, Content-Aware, feathered and non-rectangular selections keep today's behaviour.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
2026-11-08 00:57:48 -05:00
Hector VillarrealandClaude Opus 5.5 0f6524ffbd Copy CSS: write no border-radius for an unequally scaled rounded rectangle (CodeRabbit review on layer_css_cmds.rs:144)
Scaled 200 % across and 100 % down, a live rounded rectangle keeps one
radius per corner (r times the smaller scale), while its path, which is
what renders, has r·sx by r·sy elliptical corners. The rule wrote the
single circular radius. It now writes border-radius only when the path's
anchors are the ones the live radii draw (in any order, so a flipped
shape still writes its corners); otherwise none, as the module doc says.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 23:23:58 -06:00
Hector VillarrealandClaude Opus 5.5 13e7b0fe0e Copy CSS: test a rounded rectangle's border-radius after a 2x scale (CodeRabbit review on layer_css_cmds/tests.rs:165)
No test checked the copied border-radius after `shape.edit`'s
`transform` scales the live radii. With radii 12 and a uniform 2x scale
the rule now has to say `border-radius: 24px;`, so a regression in that
scaling fails the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 23:23:58 -06:00
Hector VillarrealandClaude Opus 5.5 1bdba8264d Copy CSS: write border-radius: 50% for a live ellipse (CodeRabbit review on layer_css_cmds.rs:147)
A solid live ellipse got the plain rectangle rule, so pasting it showed a
rectangle. It now writes `border-radius: 50%;` where a rounded rectangle
writes its radii, before the fill. The module doc lists it, and lists the
geometry of other shapes (live polygons, stars and lines, custom paths)
as not written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 23:23:58 -06:00
Hector VillarrealandClaude Opus 5.5 d4622f78f2 Copy CSS: test a comment closer in a name and a layer with a drop shadow (FredApps review)
A layer named `a */ b` writes no `*/` outside its quoted image name and a
sanitised class; a layer with a drop shadow writes the same rule as
without it, with no shadow and no panic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 23:23:58 -06:00
Hector VillarrealandClaude Opus 5.5 64fa77d5a6 Copy CSS: say exactly what the module writes and what it doesn't (FredApps review)
The module doc said it writes CSS "as Photoshop writes it", but strokes,
layer effects, CSS gradients, blend modes and fill opacity are never
written. List what each kind of layer gives, in order, and what is left
out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 23:23:58 -06:00
Hector VillarrealandClaude Opus 5.5 38337c8c6d Copy CSS: write a live rounded rectangle's border-radius (FredApps review)
A shape layer that is still a live rectangle with rounded corners now gets
`border-radius` before its fill, as Photoshop writes it: one value when all
four corners are equal, else top-left, top-right, bottom-right,
bottom-left, in px. Sharp rectangles write none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 23:23:58 -06:00
Hector VillarrealandClaude Opus 5.5 fc49818c58 Copy CSS: place paragraph text at its box and give it a size (CodeRabbit review on crates/engine/src/cmd/layer_css_cmds.rs:78)
Every type layer was written like point text: no width or height, placed at its first pixel.
Photoshop 2025 writes paragraph text differently. For a 200 × 120 box at (60, 40) whose two
lines span 156 × 51 px it writes `left: 59.937px; top: 36.948px; width: 156px; height: 51px;`:
placed at the box (within a few px, from its font metrics), moved down by an explicit leading
(36 px gives `top: 72.948px`), and sized by its text rather than the box (centred "Hi" in the
same box: `width: 19px; height: 17px;`). Do the same; point text keeps its position only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 23:23:58 -06:00
Hector VillarrealandClaude Opus 5.5 fc66229188 Copy CSS: escape layer and font names in quoted values (CodeRabbit review on crates/engine/src/cmd/layer_css_cmds.rs:73)
A `"` in a layer name ended `url("…")` early, a backslash started an escape, and a `"` in a font
family was turned into `'`, which names another font. Write each name as a CSS string the way
CSSOM serializes one (`\"`, `\\`, hex escapes for control characters). Photoshop 2025 writes
these names unescaped (`url("Say "hi".png")`); ordinary names come out exactly as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 23:23:58 -06:00
Hector VillarrealandClaude Opus 5.5 69305189f0 Copy CSS: start class names that begin with a digit with _ (CodeRabbit review on crates/engine/src/cmd/layer_css_cmds.rs:37)
A layer named "2nd Box" gave `.2nd_Box`, which isn't a valid class selector. Photoshop 2025
writes `._2nd_Box`: it puts a `_` in front of a leading digit and turns a hyphen into `_` like
the other punctuation ("-2x" is `._2x`, "my-box" `.my_box`). Do the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 23:23:58 -06:00
Hector VillarrealandClaude Opus 5.5 4cd60bc06b Layer › Copy CSS
Photoshop's Layer › Copy CSS puts CSS for the selected layers on the
clipboard. The new engine command layer.copyCSS writes each layer as a
class named after it (characters CSS doesn't allow become _): a type
layer's font size, family, colour, line height and alignment, a solid
fill or shape's background colour, or an image named after the layer;
then its opacity under 100 %, its absolute position and size (none for
type) and its z-index from the bottom, in Photoshop's format and order.
The Layer menu item copies the result to the clipboard.

Fixes #9372

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 23:23:58 -06:00
Hector Villarreal ea3afd57a6 Mixer Brush: Load Solid Colors Only in the load menu (#11952)
The Current Brush Load menu gets a separator and the checkable entry Load
Solid Colors Only, off by default and kept with the Mixer Brush's own brush
(MixerSettings.solid_colors_only). With it on, Alt+click loads the one
colour under the hotspot (paint.mixerLoad) instead of the sampled tip image;
off, it loads the tip image as before.
2026-11-07 22:56:23 -06:00
Trevor BrownandClaude Sonnet 5.5 7c36a5c9e9 Open as Smart Object: the reply names the document as admitted (#12212 review)
When an earlier document is held for its profile prompt and the next open skips the prompt, admission numbers the second document photo-1 again, but the reply reported the name read before admission (photo-2). The reply now reads the name from the admitted document.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
2026-11-07 23:48:22 -05:00
Hector VillarrealandClaude Opus 5.5 e49c842653 Color Replacement refusal test compares the whole surface (CodeRabbit review on crates/engine/src/cmd/color_replacement_modes_tests.rs:34)
The no-painting check looked at row 32 only; it now snapshots every pixel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 22:17:14 -06:00
yoriswind 12e50587c6 Reconcile recorded Displace with current main 2026-11-07 20:11:04 -08:00
Trevor BrownandClaude Sonnet 5.5 92ccd8b7d6 Open as Smart Object: a damage-only hold is admitted as a smart object; the name is taken again at admission (#12212 review)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
2026-11-07 23:04:32 -05:00
SBaksa 60d0895c27 Patch Tool history: refuse a bad name with Polygonal Lasso, give the step its icon
historyName is validated before polygonal picks the step name, and the
History panel shows the selection icon for a Patch Tool step.
2026-11-08 14:32:37 +11:00
Hector Villarreal 44bfd8b056 Color Replacement: whole-number Tolerance 1-100 with the alert, and the bar's tooltips (#11930)
The Color Replacement options bar's Tolerance takes whole numbers 1-100
as the Background Eraser's does (its field, now shared): a value typed
past the range becomes the closest one with the reference application's
alert, a fraction the nearest whole number, text that isn't a number
nothing. paint.colorReplacement runs tolerance 0 and below as 1, and the
bar's Mode, Limits, Tolerance and Anti-alias get the reference tooltips.
2026-11-07 21:04:07 -06:00
Hector Villarreal 60e45bb926 Color Replacement: refuse RGB/32, Grayscale, Bitmap and Indexed documents (#11923)
paint.colorReplacement and its live stroke refuse the modes and depths
the reference application refuses, with its words: 32 bit per channel
RGB, Grayscale and Bitmap (only full color modes), and Indexed Color.
Nothing is painted and no history is added. RGB/8, RGB/16, CMYK and Lab
paint as before; cases that weren't measured keep today's behaviour.
2026-11-07 21:00:56 -06:00
Trevor BrownandClaude Sonnet 5.5 022cf4f125 Open as Smart Object: keep the damage flag, the Smart Object flag and unique names
CodeRabbit round 2 on #12212:
- 4504550937 (b): a PSD that recovered from damaged data is held for File > Open's confirmation (the app passes confirmDamage; headless callers open it as before).
- 4504550942: a document held for its prompt counts when numbering, and the number is re-taken when each document is admitted, so two held files with one stem no longer share a name.
- 4504550943 is not changed here (needs colour transforms at regeneration), as are 4504550937 (a), (c) and 4504550953.
- 4504550946: the successful reply carries smartObject, so a document queued behind another open prompt is admitted with the Open As Smart Object history label.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
2026-11-07 21:59:52 -05:00
Triwarr 2d16a609ea Merge remote-tracking branch 'origin/main' into pdf
# Conflicts:
#	docs/scorecard.md
2026-11-08 03:48:47 +01:00
Hector Villarreal 6b9628c92f Color Replacement: History names each edit "Color Replacement Tool" (#11933)
A Color Replacement click, stroke or Shift+click segment adds one History
state named "Color Replacement Tool", as in the reference application.
The command's label is the same name, so a recorded action's step reads
the same as the History state.
2026-11-07 20:47:03 -06:00
David Mann 62776f4b58 Merge branch 'main' into feat/export-last-folder-10192 (merge queue) 2026-11-08 03:45:33 +01:00
ea37bf8bd9 #9077: drop the map_pixels wrapper the main merge left unused
Main's Equalize change (58d11d91ea) moved Equalize to map_pixels_in, and this PR
moves Average off map_pixels, so after merging main the wrapper had no caller and
clippy -D warnings failed on dead code. Fold its doc into map_pixels_in.

Co-Authored-By: ArjenS-LA <ArjenS-LA@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 03:30:26 +01:00
517d0a9eea Merge origin/main into #9887 (Indexed Color Matte)
Keeps main's Fade preview path in filter_preview.rs and passes the PR's
tool colours to the non-Fade preview; catalogs keep both sides' rows.

Co-Authored-By: Firstbober <firstbober@tutanota.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 03:23:31 +01:00
SBaksa 974c32ddc6 Patch: History names as the tool's (#12117)
select.lasso takes an optional historyName; the Patch tool sends "Patch Tool" so its
lasso is that step (the Lasso tool keeps "Lasso"). paint.patch records "Patch Selection"
in every mode; the content-aware job keeps its progress text.
Tests: patch_history_names_tests (engine) and patch_tool_history_names_tests (ui-egui).
2026-11-08 13:09:17 +11:00
David Mann d95faebaa3 Merge remote-tracking branch 'origin/main' into pr-9077
# Conflicts:
#	docs/gaps.md
#	docs/target-app-parity.md
2026-11-08 03:04:43 +01:00
David Mann 9da3cda6a7 Merge origin/main into feat/raw-xmp-crop
# Conflicts:
#	docs/file-format-parity.md
2026-11-08 02:56:35 +01:00
David Mann b30c5c8095 Merge pull request #12142 from hectorviov/fix/star-tool
Toolbar: Star Tool in the shape slot between Polygon and Line (#11377)
2026-11-08 02:56:14 +01:00
David Mann ed893ea812 Merge pull request #12188 from davidmann4/fix/11909-bg-eraser-tolerance-field
Background Eraser: Tolerance takes whole numbers 1-100 with an alert, bar tooltips (#11909)
2026-11-08 02:54:43 +01:00
David Mann 4a7d746c0a Merge pull request #11823 from davidmann4/fix/11812-brush-opacity-minimum
Brush: opacity minimum 1 % and "00" sets 100 % (#11812)
2026-11-08 02:49:28 +01:00
Trevor BrownandClaude Sonnet 5.5 2341642056 Open as Smart Object: import on a worker and complete through File > Open's colour policy and prompts (#11678)
The command is a job (inline under execute, a worker under start) that returns File > Open's result shape; the UI tracks it as an OpenTab so finish_open gives it the profile prompt (held, admitted with the smart object label) and after_open gives a raw the Camera Raw open dialog and the import warnings. Import options and the Color Settings policy match File > Open. The paths form is removed: the UI calls the command once per file.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Fable 5.1 briefed; Sonnet 5.5 wrote at medium
2026-11-07 20:38:18 -05:00
Trevor BrownandClaude Sonnet 5.5 b29fdc5a29 Open as Smart Object: the opening snapshot shows the placed smart object (#11678)
The smart object layer is built into the document before admission, so snapshot 0 holds it and the history is the single state "Open As Smart Object", as File > Open's is one state.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Fable 5.1 briefed; Sonnet 5.5 wrote at medium
2026-11-07 20:05:43 -05:00
Hartmut Nörenberg b170944c3e fix(engine): the Type tool converts only the text #12041 measured
Paragraph (box) text and vertical type are on the issue's *Not measured* list, whose rule is that
an unmeasured case keeps today's behaviour - and a coverage mask could not give back a box that
reflows or a column that stacks its lines, so their editable type layer stays. The commit converts
the measured case only: horizontal point text in an Indexed Color or a Bitmap document. The Type
Mask tools keep turning both into the selection, as they do today; there the user asked for one.

Also pin what happens when an edit that carries no coalesce key - the deliberately per-press
Alt+arrow kerning step - comes between the typing and the commit: the commit is a state of its own,
named for the type layer, exactly as the Type Mask commit and the plain layer's rename are in that
situation today. Nothing is mis-named; folding those states together would delete history the user
can undo today and belongs with #12039.

Tests: commits_as_selection across shape and orientation; the tool's commit of box and vertical text
in both modes; the split states and what each undo takes.
2026-11-08 02:03:17 +01:00
8da11e891a PR #9991: Batch's quiet RAW opening applies the sidecar crop
Main added a non-interactive RAW opener for Batch while #9991 was open. It refused a
sidecar whose crop keys were unsupported. #9991 moves those keys from the ignored list into
LoadReport::crop, so after the merge Batch would drop the crop without saying so. It now
passes the crop into RawTuning, as the interactive open does.

Co-Authored-By: ljkx <177671075+ljkx@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 01:54:33 +01:00
Trevor Brown 585408de67 Merge remote-tracking branch 'upstream/main' into feat/open-as-smart-object-11678 2026-11-07 19:51:04 -05:00
David Mann 9ac3fa22b2 Merge pull request #9280 from davidmann4/fix/crop-invalid-rect
Crop: refuse an invalid explicit rectangle instead of cropping to the selection (#9279)
2026-11-08 01:50:23 +01:00
David Mann 940b352ca0 Merge pull request #9256 from davidmann4/fix/scale-effects-bevel-texture
Scale Effects and Image Size scale Bevel & Emboss Texture's scale (#9254)
2026-11-08 01:50:08 +01:00
David Mann 9849f778d8 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/gaps.md
#	docs/scorecard.md
#	docs/ui-parity.md
2026-11-08 01:43:45 +01:00
Hartmut Nörenberg 1b0a3e1336 fix(engine): refuse Straighten Layer for a target that is gone
`Session::edit` keeps the selected layers valid after an edit but not the active id, so an
edit that drops the active layer leaves one behind that the document does not hold. The new
enabled check read that id and answered "live", and with an explicit `crop` the command then
rotated and cropped the whole canvas for a layer that is not there - the one outcome of this
state that changes pixels. Refusing it is what `select_layer` and `restore_layer_selection`
already do with a gone id, and it costs the resolve check the target lookup was doing anyway.
No command shipped today drops the active layer without re-targeting, so no real document
changes behaviour: this is the guard the review asked for, and the test reaches it through
`Session::edit` directly.
2026-11-08 01:40:36 +01:00
Hector VillarrealandClaude Opus 5.5 4a8e26a11a Notes: after a turn or flip the popup keeps today's origin, with its size kept (CodeRabbit review on crates/engine/src/canvas_geom.rs:252)
#11795 didn't measure where the popup sits after a rotation, so that case keeps today's placement
(the top-left of the mapped rectangle) and only the size rule applies. Image Size and Canvas Size
still keep the popup's offset from the icon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 18:25:41 -06:00
Hector VillarrealandClaude Opus 5.5 b7e71b9ed5 Notes: an unset (all-zero) popup stays unset under Image Size, Canvas Size and turns (CodeRabbit review on crates/engine/src/canvas_geom.rs:252)
PSD export writes its default popup for an all-zero one; moving it with the icon turned it into
a 0 x 0 rectangle elsewhere, which export then wrote as is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 18:23:00 -06:00
Triwarr 0525197133 Merge remote-tracking branch 'origin/main' into pdf
# Conflicts:
#	docs/scorecard.md
2026-11-08 01:09:29 +01:00
David MannandClaude Opus 5.5 4750447f23 Floor an imported brush's opacity at 1 % when it is selected
Importing an .abr with select picked its first brush without the 1 %
opacity floor, so a preset saved at 0 % showed 1 % but painted nothing
(#11812).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 01:03:17 +01:00
David MannandClaude Opus 5.5 6547fadccd Floor a restored brush's opacity at 1 %
A brush remembered at 0 % opacity (saved before the 1 % floor) read back
at 0: the options bar showed 1 % but strokes painted nothing. Restoring
now floors opacity at 1 %, like tools.setBrush (#11812).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 01:24:18 +00:00