Commit Graph
3978 Commits
Author SHA1 Message Date
Tanish Manku 4313eb2dbe Merge pull request #9319 from DuBearte/feat/8351-gradient-map-source
feat: Gradient Map keeps Photoshop's stops, midpoints and smoothness (#8351)
2026-11-11 00:03:04 -07:00
Tanish Manku 9d56f14680 Merge pull request #9311 from hectorviov/fix/artboard-new-layer
test: new layers made with an artboard selected go inside it (#9147)
2026-11-11 00:02:12 -07:00
Tanish Manku f12cd5dff3 Merge pull request #9246 from DuBearte/fix/9236-cmyk-split-channels
fix(engine): CMYK Split Channels reads the composite's exact inks (#9236)
2026-11-11 00:01:49 -07:00
Tanish Manku dc855ae902 Merge pull request #6864 from hidoba/codex/curves-followup-fixes
Fix remaining grayscale Levels/Curves target mismatches
2026-11-10 23:57:32 -07:00
Tanish Manku c2e8c4db82 Merge pull request #6787 from ingling/spot-dot-gain
Color Settings › Spot: dot gain for spot channel and Multichannel ink previews
2026-11-10 23:57:09 -07:00
Alon 78b6991124 fix(engine): keep missing-font type pixels through Image Size (#8860)
Fixes #8860

The Export As preview showed text in the wrong font when the PSD's font isn't installed, even though the canvas and the exported file looked fine.

The preview shrinks a copy of the doc with Image Size, and Image Size re-drew every text layer from its text, falling back to the default face when the font was missing. The same thing happened on any non-100% export and on Image › Image Size itself.

Now when the image is resized, text in a missing font keeps its own pixels (resized) instead of being re-drawn. Text in installed fonts still re-draws sharp as before.

**Test:** open `corpus/photoshop/text/point-fonts-mixed-runs.psd` (on a machine without Arial/Georgia/Times/Courier), press Ctrl+Alt+Shift+W, and the preview now matches the canvas. 

Added a regression test too.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
  * Text layers with unavailable fonts now retain their existing appearance when resizing images or applying arbitrary rotation, rather than losing or changing their cached pixels.
  * Text using an installed font continues to be re-rendered during these operations, preserving the expected behavior.
  * These improvements apply to 8-, 16-, and 32-bit documents, including text layers nested within groups.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-11 07:41:22 +01:00
Michael Higgins 58fdc84eb5 Keep automation's gate on actions automation wrote, whoever plays them
## Summary

A client confined to its automation roots could write an action without running it: `actions.load {data}`, or `actions.insert` of any step. It could also bind the action to a key. None of that touches a file, so the policy allows it. Playback is gated by `Session::authorize`, which is installed only while automation drives the app. So when the user later pressed the key, or played the action from the panel, its file steps ran with the user's access, outside the roots. On 0.16.0 a planted open-and-save-a-copy action ran on one real keypress.

- **The mark:** `Action` gets an `automation` flag, persisted with the action list. It is set when an action is loaded, recorded, or has steps inserted, deleted, moved or toggled while `Session::authorize` is installed. It is also set when a step is journaled into the user's recording while `Session::authorize` is installed: an engine command a control client runs, a shell save or view step, or a call to an action (`actions_cmds::note_automation_step`). A background job keeps its request's origin: `dispatch` records on the job whether its request ran under a gate when it is admitted, and `apply_job` uses that, not the gate of whichever caller polls or waits on the job, and only for the recording that owns the step (`actions_cmds::note_step_origin`).
- **The gate:** `Session` gets `automation_gate`, the desktop's automation policy. `PhotocraftApp::new` fills it from `Services::automation_authorize`.
- **Playback:** engine playback (`actions.play`) and shell playback (`actions::play`) install that gate for a marked action that plays with none installed. Its steps, nested calls and the commands they run on their own behalf all meet the policy. A paused step dialog's command is judged under the same gate, and on resume each marked action takes its gate again, so its callers and the rest of a set keep their own gate.
- **Unchanged:** the user's own actions, and sets the user loads through Load Actions…, keep the user's access.

Not covered: File › Automate › Batch and droplets take a copy of the steps rather than the action, so they don't see the flag. That needs the Batch dialog to carry the action's origin, a separate change.

Closes #9782

## Tests run locally

- New `actions_cmds::tests::actions_automation_wrote_keep_its_gate_when_the_user_plays_them` (engine). A set loaded and a step inserted under an automation gate are refused when played without one, directly and through a nested call. The user's own action runs, a set the user loads is not marked, and the gate is removed after playback.
- New `actions::tests::a_users_key_plays_an_action_automation_wrote_under_its_gate` (ui-egui). A marked action bound to F9 and dispatched as the user's key press has its `file.openAs` step refused, and the refusal is reported.
- New `actions::tests::a_kept_gate_does_not_carry_into_the_rest_of_a_set_after_a_pause` (ui-egui). A set the user plays pauses at a marked action's step dialog; after OK the user's own action later in the set runs with the user's access.
- New `actions_cmds::tests::a_step_automation_runs_into_the_users_recording_keeps_its_gate` (engine, run by CI). The user records; a `file.new` run under a client's gate and a call to an action the client plays mark the recorded action, which is refused when played ungated. The user's own recording stays unmarked and plays.
- `a_kept_gate_does_not_carry_into_the_rest_of_a_set_after_a_pause` now also refuses the marked action's tail step `a2` and checks it is refused after OK (run by CI).
- New `jobs::tests::a_job_a_gated_client_starts_into_a_recording_keeps_its_gate_when_applied_ungated` (engine). A gated client starts a Gaussian Blur job during the user's recording; the gate is removed before `wait_job`; the recorded action is marked and, played ungated, its step is refused by `automation_gate`.
- New `jobs::tests::a_users_job_applied_while_a_gated_client_waits_stays_the_users` (engine). The user's job applied while a gated caller waits stays unmarked and plays; a gated client's job applied during a recording started after it does not mark that recording.
- The two `jobs::tests` above and the merge of `main` (commit 842ea34b4) were not built or run locally; CI runs them.
- `cargo test -p photocraft-engine --lib actions_cmds`: 33 passed. `cargo test -p photocraft-ui-egui --lib -- actions:: shortcut_dispatch`: 71 passed.
- With the kept gate switched off (`kept_gate` returning `None`), both new tests fail.
- `cargo fmt`.


<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
  * Automation authorization remains in effect when automation-created or edited actions are replayed, including through shortcuts and nested actions.
  * Actions loaded by automation retain their authorization policy during playback, while user-created and user-loaded actions remain distinct.
* **Bug Fixes**
  * Playback no longer loses automation authorization when an action runs later. If a step is denied, it is not performed, and the temporary authorization check is cleared after playback.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-11 07:36:02 +01:00
Terra854 453ea8c9ca [Extend XCF import into native PhotoCraft documents 1/6] Persist import conversion data and bounded native filter foundations
Imported documents need durable conversion evidence and native pixel operations before XCF conversion can produce editable PhotoCraft data. This adds bounded document/report types, lossless pattern construction and `.pcraft` persistence, plus native HDR, percentile, noise, convolution, Average, coverage and matting kernels and checked Smart-filter mixing. Runtime color models/depths are retained; source attachments remain inert. Native SVG operations retain parsing, lowering, rendering and parser-tree destruction on one bounded worker, including nested resources; WebAssembly reports a controlled error for depths requiring native isolation.

Native filter corrections cover matte black points and signed HDR, extent-wide Smart-filter coverage, flat-image identity Auto Levels, opaque FillHoles capability, exact unselected channel preservation, coverage-preserving Average selection and bounded pattern expansion. Checked Smart-filter mixing rejects nonfinite native F32 samples, preserves unchanged Normal pixels without regenerating CMYK separations, and recovers representable alpha mixtures after an overflowing difference. HDR blend overflow retries use cold F64 arithmetic while retaining ordinary finite results and integer-depth behavior. Both opaque and alpha-bearing F32 mask recovery retain signed/HDR colors.

Stored pattern declarations remain lossless and inert. Dense PSD/PAT/ASL pattern export now checks dimensions and one shared plane-allocation budget before conversion. PAT/ASL report conversion errors; PSD/PSB report named omission warnings. Matching raw PSD pattern blocks remain verbatim. CMYK offsets retain the established brightness convention.

Command registration, XCF decoding and frontend workflows follow in dependent parts. The contributor entry is the author's existing chosen entry.

<!-- native-foundations-fixes-20261107:start -->
Small noise, convolution and point-operation edits admit their clipped work area on large owners while retaining output/workspace limits and whole-owner FillHoles bounds. HDR toning retains skipped transparent native samples. Normal Smart-filter strength interpolates stored CMYK/Lab/ink planes with premultiplied coverage, preserving unchanged channels. Bitmap Custom Pattern reads compact patterns in bounded row bands and ranks the complete map once. Embedded SVG isolation failures propagate independently of strict mode; ordinary invalid images can still be omitted, and private native parses share the complete-operation worker. The import-report regression now primes the layer blob cache and requires its specific limit diagnostic.
<!-- native-foundations-fixes-20261107:end -->

<!-- adversarial-5810371597:start -->
Import-report accounting uses portable fixed costs. HDR scene means use F64. Bitmap pattern ranking preflights a 256 MiB input/order/output budget, uses fallible allocation and heap-scratch-free sorting. Average uses the supplied image domain and retains one global mean across output tiles. Non-Normal Smart-filter coverage is classified once across the complete mixing extent. A fallible filter dispatcher and engine error conversion preserve checked native diagnostics and cancellation. Smart-filter engine integration remains in part 5 (#11032).
<!-- adversarial-5810371597:end -->

## Six-part series

Each branch is hosted in Terra854/photocraft, and every PR targets storytold/photocraft:main. Merge in the order below. Later drafts currently show cumulative diffs while prerequisites are unmerged; their descriptions link to isolated comparisons. Rebase each part onto current upstream main after its prerequisites merge, including squash-merge ancestry, and rerun affected checks before requesting review.

| Part | Upstream PR | Fork branch | Scope |
| --- | --- | --- | --- |
| 1 | [#11009](https://github.com/storytold/photocraft/pull/11009) | xcf-support-v2-01-import-data | Document/native-format data and pixel foundations |
| 2 | [#11029](https://github.com/storytold/photocraft/pull/11029) | xcf-support-v2-02-decoder | Bounded transport/records, precision, metadata, editable text and paths |
| 3 | [#11030](https://github.com/storytold/photocraft/pull/11030) | xcf-support-v2-03-effects-core | Native effect frames and primary tone/color/spatial/resource/transform adapters |
| 4 | [#11031](https://github.com/storytold/photocraft/pull/11031) | xcf-support-v2-04-effects-graphs | Remaining adapters, bounded graph lowering, coverage installation and source evidence |
| 5 | [#11032](https://github.com/storytold/photocraft/pull/11032) | xcf-support-v2-05-engine | Native commands, import preparation, historical choices, editing and persistence workflows |
| 6 | [#11033](https://github.com/storytold/photocraft/pull/11033) | xcf-support-v2-06-frontends | Desktop/web UI, CLI/MCP, translations, GPU diagnostics and qualification/docs |

The full integration remains preserved on `xcf-support-v2`; original #7098 remains available for reference.

## Validation

<!-- main-catchup-0d08cb7dd:start -->
Updated to upstream `main` at `0d08cb7dd` and restacked all six branches. Part 1 is `640a01f43`; full integration is `24cd17301`. The final six-part tree exactly matches the full integration tree.

The merge preserves both upstream's new tests/crop translations and the XCF historical-open tests/report labels. The automation adapter now preserves import-source protection across multiple granted read roots: relative source names cover every matching candidate so newly shadowing files cannot expose the original to overwrite, while absolute source names remain precise. Existing ordered reads and implicit-save provenance are retained. Read-only import source identity is kept independently of whether its library root grants an implicit Save target. Focused regressions cover source aliases, removed files, denied candidates, changing root precedence, and read-only library imports; the Windows escape fixture also uses a real junction when symlink privileges are unavailable. The new upstream UI import fixture also uses the native import outcome type.

Local validation passed affected host all-target checks, core and native frontend/automation unit and integration suites, forced-Vulkan GPU unit and integration suites, pinned IO corpora, strict all-target Clippy, formatting, layering, panel command dispatch, WASM, adversarial command tests, and the quick CPU performance harness. Offscreen historical-XCF prompt and conversion-report captures were reviewed. The first two PR boundaries also passed independent all-target engine checks. Tests used the pinned craft-fonts input, four Rayon workers, serial tests for large fixtures and opt-level=0 for engine/UI test glue; pixel/format crates retained their repository settings. Quick mode uses small documents and does not enforce full-size budgets. The part 1 push triggered fresh [CI](https://github.com/storytold/photocraft/actions/runs/42885527754) and [SonarCloud](https://github.com/storytold/photocraft/actions/runs/42885527740) runs. After upstream approval, CI passed the Linux gate, Windows unit/integration tests, no-HEIF tests, pinned corpora and web build. SonarCloud's instrumented archive, coverage shards and actual scan remain skipped behind its token guard; its outer green status does not mean coverage ran. Catching up with main therefore retriggered normal tests but did not remove that SonarCloud skip. Older validation below remains evidence for its explicitly named earlier commits.
<!-- main-catchup-0d08cb7dd:end -->

<!-- average-no-extent-4517477902:start -->
Average no-extent follow-up at part 1 `f8ddb626f` (full integration `882def329`), carried through all six branches. The checked Average dispatcher now uses the requested `area` when no owner extent is supplied; an explicit extent retains its existing clipping behavior. Other filters, the Average pixel kernel and resource admission are unchanged.

The new regression fails against the preceding revision and passes with the fix. It covers `apply`, one-pixel explicit tiling, and the cancellable tiled API at 8/16/32-bit, signed/HDR colors, hidden RGB, native alpha preservation, unchanged source data and pixels outside the requested area. Validation passed the algorithm unit/integration suite (935 tests; 27 existing ignored), strict all-target algorithm Clippy, formatting, layering, WASM (24 crates plus HEIF), and independent all-target engine checks of the first two PR boundaries. The broader suites below remain evidence for their named earlier commits and were not rerun for this dispatcher-only follow-up.
<!-- average-no-extent-4517477902:end -->

<!-- review-20261110:start -->
Review follow-up at part 1 `a3144d559` (full integration `b5fd3e211`), carried through all six branches. Average admits long thin regions within its existing pixel/workspace budgets, clamps finite selection coverage, and uses owner extents for off-canvas replay. HDR Toning also adapts over the owner extent. Pattern GPU uploads now use bounded bands; the warning-free `document_to_psd` API returns `Result` on pattern export failure and reuses prepared pattern blocks. Warning-enabled exports retain explicit omission warnings.

Five filter regressions fail against the previous revision and pass with the fixes. Local validation passed 1,597 algorithm/compositor/GPU tests with Vulkan, all 129 GPU integration tests separately on DX12 with FXC (the app uses FXC when no bundled DXC is present), a separate forced DX12 pattern upload/readback test, 1,144 IO unit and 675 pinned IO integration tests, 10 affected engine tests, strict all-target Clippy, formatting, layering, WASM and quick CPU performance checks. The first two PR boundaries passed independent all-target engine checks. This Intel driver's DX12/DXC configuration rejects the unchanged `fs_adjust` pipeline (`0x80070057`); DX12/FXC and Vulkan both pass. The full workspace suite was not rerun; earlier broad evidence below remains tied to its named commits. Quick performance mode does not enforce full-size budgets.

A separate 24 MP signed/HDR RGBA32F public Average-kernel probe retained exact mean RGB and original alpha. Three alternating runs had medians of 1,274.713 ms before and 1,259.885 ms after; this small difference is within run variation and is not a speedup claim.

The Minor/Poor-tradeoff report-deserialization finding remains open and documented. Encoded records are capped at 32 MiB and individual arrays are bounded, but compact targets can still amplify transient decoded memory before aggregate validation rejects the report. Early shared-budget deserialization is not implemented in this follow-up.
<!-- review-20261110:end -->

<!-- main-catchup-7c64653d5:start -->
Updated to upstream `main` at `7c64653d5` and restacked all six branches. Part 1 is `cbf068d5f`; full integration is `206f71012`. The full integration tree exactly matches part 6.

The merge retains main's alpha-preserving Average behavior with bounded checked processing, and uses it consistently for XCF coverage conversion and native replay. Historical XCF normalization and import preparation now run through main's resumable Place flow and Open as Smart Object; regression tests cover source byte order and native Edit Contents. XCF report/filter labels also cover the seven languages main promoted to menu-complete status.

The current tree passed affected host all-target checks, core/IO, GPU, engine and frontend suites, strict all-target Clippy, formatting, layering, panel command dispatch, WASM and the web build, adversarial command tests, pinned IO corpora and the quick CPU performance harness. Offscreen historical-XCF prompt and conversion-report captures were reviewed. The first two PR boundaries also passed independent all-target engine checks. Tests used CI-pinned craft-fonts `b076417b5880bd4154bd22f00695b1d28c6bea83`, four Rayon workers, serial tests for RAM-heavy suites and opt-level=0 for engine/UI test glue; pixel and format crates kept repository settings. Quick performance mode uses smaller documents and does not enforce full-size budgets. Older measurements below remain evidence for their named earlier commits.
<!-- main-catchup-7c64653d5:end -->

<!-- percentile-owner-4502952267:start -->
Percentile owner-bounds follow-up at part 1 `93946db04` (full integration `f7264af14`): nonempty owner bounds now supply edge samples without a dense whole-owner admission check. The unchanged preflight still bounds clipped output, padded halo, workspace and CPU work; dense-image adapter limits remain in place. Two new regressions failed with `InvalidGeometry` before the fix and pass afterward, covering small edits on 81 MP and wider sparse owners, clamped-edge oracles, fractional selections, source preservation, clipped requests, invalid domains, oversized output, work limits and cancellation.

This follow-up passed 903 algorithm tests (887 unit + 16 integration; 27 existing ignored), all-target strict algorithm Clippy, formatting, layering and WASM (24 crates plus the HEIF configuration). Only sampling-bound admission changed; percentile processing and resource-preflight code are byte-for-byte unchanged. The broader qualification below remains tied to its explicitly named earlier commits; the full workspace suite was not rerun for this one-file follow-up.
<!-- percentile-owner-4502952267:end -->

<!-- native-foundations-validation-20261107:start -->
The production fixes at part 1 `c16e274b8` (full integration `6f8349cd5`) passed 7,245 affected algorithm/compositor/document/engine/native-format/IO tests across 46 binaries, with 65 existing ignored tests, plus doctests, affected all-target strict Clippy, layering, WASM, adversarial command tests, formatting and the pinned IO corpus (1,107 unit + 661 integration tests, 26 existing ignored). The final diagnostics regressions also passed independently on the foundation and full integration branches. The first PR passed an independent all-target engine check. Tests used four Rayon/test workers and the existing CI font pin; engine test glue used opt-level=0, and the foundation-only diagnostic probe also used opt-level=0 for its algorithm dependency. The full integration tree exactly matches the final sixth branch.

Paired 24 MP release probes used three timed repetitions per version after warm-ups, alternating order, matching inlining controls, opaque parameters and a current public-API control, with four Rayon workers. Timings are completed operations on this host.

| Probe | Before (ms) | After (ms) | Public API (ms) |
| --- | ---: | ---: | ---: |
| HDR toning | 830.3 | 834.4 | 791.2 |
| Rgb-Normal | 1070.5 | 1069.3 | 1079.7 |
| Cmyk-Normal | 683.0 | 669.7 | 691.5 |
| Rgb-Multiply | 1103.1 | 1303.3 | 1297.5 |

The extent-wide coverage prepass adds 200.2 ms (18.2%) in the alpha-preserving Multiply case. This is the measured cost of applying one consistent coverage rule; the Normal RGB/CMYK controls remain near baseline.

The uniform HDR probe's middle-gray output changed from 0.200004 to 0.180000 (target 0.18); the public control agrees. Mixer probes check native colors and alpha at sampled positions. The quick CPU application harness also completed; its saved cross-machine comparison was skipped, and quick mode does not apply full-size budgets. No budgets or baselines changed.
<!-- native-foundations-validation-20261107:end -->

Earlier validation of full integration `c003e3f50`, before these follow-up fixes, completed the upstream `main` catch-up at `c101cbfb7` on 2026-11-07. The cumulative series passed affected host all-target checks, foundation and IO suites, GPU, engine and frontend suites, strict Clippy, layering, WASM, adversarial command tests, formatting, pinned IO corpora and the quick CPU performance harness. Offscreen historical-XCF prompt and conversion-report captures were reviewed. Local tests used CI-pinned craft-fonts `b076417b5880bd4154bd22f00695b1d28c6bea83`, four Rayon workers and temporary opt-level=0 overrides for engine/UI test glue; pixel and format crates retained repository settings. The full UI library passed 5,330 tests, and the final dialog-dispatch cleanup passed 945 focused dialog tests.

The decoder and engine PR boundaries also passed independent all-target checks. The full `xcf-support-v2` integration tree matches the final sixth branch exactly. SVG stack regressions retain their 512 KiB caller, isolated complete native lifecycle and 100 retained group levels.

The matched performance figures below were measured before this main integration; the HDR recovery arithmetic and bounded tile implementation are preserved.

Forward filter-mask mixing retains its existing four-buffer allocation optimization and arithmetic. Its matched 24 MP RGBA32F probes measured opaque pixels at 392.410→182.842 ms, semitransparent pixels at 383.321→179.916 ms, and signed HDR pixels at 373.696→183.903 ms (five-run medians, 50–53% faster).

Inverse filter-mask recovery now processes at most eight native tiles in parallel, with four reusable scratch buffers per slot and ordered surface publication. Small inputs, one-worker operation and WebAssembly use the same serial tile helper. All F64 and integer pixel arithmetic is unchanged. Bitwise regressions compare full/partial/missing tiles, negative coordinates, differing defaults and hidden/zero-alpha outputs across 30 format combinations; an explicit one-worker/two-worker comparison checks both execution paths.

Matched 24 MP HDR inverse-recovery public-API probes measured 166.972→90.565 ms (opaque, 45.8% faster), and 433.325→130.707 ms (semitransparent, 69.8% faster). Five-run medians use four Rayon workers on this host; all runs assert recovered HDR samples at three positions. The existing F64 precision and HDR saturation bounds are preserved.

Mask recovery retains signed/HDR colors, extreme finite values, subnormals and exact full coverage. The PSD/PSB regression uses a real blur on spatially varying HDR pixels and partial masks; raw exported channels must match the unmasked filter result, and reimported Smart caches must match independently authored masked values.

The prior quick CPU application harness completed. Its saved cross-machine baseline comparison was skipped, so the paired public-API measurements above provide the direct before/after evidence. No performance budgets or baselines changed.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
  * Added image adjustments and filters for averaging, channel noise, convolution, percentile effects, alpha and coverage editing, black matte removal, HDR toning, and automatic tone, contrast, and color correction.
  * Added Smart-filter blending controls for opacity and blend modes.
  * Import-conversion information is preserved when saving and reopening documents.

* **Improvements**
  * Improved handling of deeply nested SVGs and large patterns, with bounded pattern processing and warnings when pattern export is not possible.
  * Improved stability when blending extreme HDR values and applying filters to HDR images.
  * Improved transparency handling for channel-selective filters and added clearer feedback when image processing or export cannot be completed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-11 07:35:40 +01:00
skylar taylor-barrick 1f77e59589 Merge origin/main (2772ac1e7) into craft-i18n cutover
Keep all 34 catalog deletions; sync crop options and fill rasterization text via craft-i18n 4a642c06dbcb8172f307f827c1167cd5dd8ac341. Adapt the fill prompt catalog test to embedded catalogs and preserve both parity-document updates.
2026-11-10 20:16:09 -06:00
David Mann 2772ac1e77 Merge pull request #13031 from ljkx/feat/smudge-tool-mode
Smudge: Mode dropdown in the options bar (#12959)
2026-11-11 02:59:37 +01:00
David Mann 097ebb21f4 Merge pull request #13028 from ljkx/feat/pattern-stamp-behind
Pattern Stamp: Behind in the Mode list, painting only where the layer is transparent (#12879)
2026-11-11 02:59:24 +01:00
David Mann db16701427 Merge pull request #13080 from rmsff/fix/background-eraser-channel-refused-12488
Background Eraser: refuse one colour channel of an RGB document
2026-11-11 02:41:26 +01:00
ljkxandClaude Fable 5.2 b1c3ca7e84 Merge main into feat/pattern-stamp-behind
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 02:04:55 +01:00
ljkxandClaude Fable 5.2 928a523208 Merge main into feat/smudge-tool-mode
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 02:04:50 +01:00
David Mann 6a712d54c9 Merge pull request #12908 from hectorviov/fix/eraser-gray-background
Eraser and Fill: background swatch through the Grayscale document's grey profile (#11940)
2026-11-11 02:00:53 +01:00
David Mann 7f4e4461bb Merge pull request #12983 from rmsff/fix/history-brush-format-mismatch-12842
History Brush: refuse a source of another colour mode or bit depth
2026-11-11 01:57:03 +01:00
David Mann 7539e14dce Merge pull request #12869 from Raghav2012Code/fix/12852-object-transparent-layer
fix(engine): Object Selection finds objects on a transparent layer (#12852)
2026-11-11 01:56:43 +01:00
rmsff af2fe890f8 Test the Background Eraser refusing one colour channel 2026-11-11 03:48:24 +03:00
rmsff e7c68638ce Background Eraser: refuse one colour channel of an RGB document
With only Red, Green or Blue targeted the reference application refuses
the stroke ("target channels do not cover the composite"), erases nothing
and adds no History state. The check sits in the setup shared by the
command and its live preview, so the preview draws nothing either. The
composite and the partial sets that weren't measured keep erasing.

The transparency-lock preview test targeted Green alone; it targets
Green and Blue now. Its helpers are pub(super) for the new tests.
2026-11-11 03:48:24 +03:00
ljkxandClaude Fable 5.2 cd81562c4e Merge main into feat/smudge-tool-mode
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 01:33:13 +01:00
David Mann c882bfd832 Merge pull request #13043 from rmsff/fix/red-eye-refuses-non-rgb-12575
Red Eye: refuse CMYK, Grayscale and Indexed Color documents
2026-11-11 01:26:57 +01:00
David Mann c908c79235 Merge pull request #12355 from rmsff/fix/type-mask-off-canvas-12074
fix(engine): a Type Mask keeps the part of its selection past the canvas edge (#12074)
2026-11-11 00:55:07 +01:00
David Mann 18ec9b1dc8 Merge pull request #12334 from rmsff/fix/vertical-type-history-name-12058
fix(engine): new vertical text is the history state "New Vertical Type Layer" (#12058)
2026-11-11 00:53:57 +01:00
David Mann d58afecac9 Merge pull request #12244 from ElNeMeR70/fix/gradient-live-drops-selection-12196
fix(engine): drop selection after masking a live Gradient Fill layer
2026-11-11 00:53:39 +01:00
David Mann 5ba0bb0a3a Merge pull request #12201 from hectorviov/fix/eyedropper-zoom-box
Eyedropper: at 100 % zoom and below an N by N Average covers (N+1) x (N+1) screen pixels (#11751)
2026-11-11 00:51:27 +01:00
David Mann e9ab58e1f5 Merge pull request #12209 from DuBearte/fix/11966-auto-erase-exact
Pencil Auto Erase: the start pixel must be exactly the foreground colour
2026-11-11 00:51:02 +01:00
rmsff ab19246243 Test the Red Eye tool's colour mode refusal 2026-11-11 02:04:08 +03:00
rmsff 9c7e055957 Red Eye: refuse CMYK, Grayscale and Indexed Color documents (#12575)
A click in these modes opens the reference's alert instead of running, and paint.redEye returns the same text, leaving pixels and History unchanged. The two tests that expected CMYK to run and Grayscale to miss now expect the refusal.
2026-11-11 02:04:08 +03:00
ljkxandClaude Fable 5.2 5d6a491060 Pattern Stamp: grey Behind in the options bar on the Background; Impressionist keeps its pixels (#12879)
- The options bar's Mode dropdown greys Behind when the Background is the
  active layer, as the Shift+right-click menu does: the entry is drawn
  disabled, a click on it picks nothing, and the wheel and the keys step
  past it. On a pixel layer it is enabled. Only the Pattern Stamp's
  dropdown uses the new greyed-option variant of the dropdown widget.
- Behind with Impressionist was not measured, so an Impressionist stroke
  again gives exactly the pixels it gives in Normal, committed and live,
  when Behind is picked. The per-dab Behind code is removed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 23:59:10 +01:00
ljkxandClaude Fable 5.2 aca4544af5 Smudge: Mode dropdown in the options bar (#12959)
The Smudge options bar gets Mode: (Normal, Darken, Lighten, Hue,
Saturation, Color, Luminosity; tooltip "Painting Mode"), first after the
brush controls. `paint.smudge` takes `mode` and refuses any other name;
the stroke sends it and Reset Tool sets Normal.

With a Mode other than Normal each dab's smudged colour is blended with
the pixel from before the stroke the way a paint colour would be, and
laid down through the tip's coverage. 8-bit RGB only: other colour modes
and depths were not measured and keep smudging as Normal. Blur and
Sharpen are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 23:15:42 +01:00
ljkxandClaude Fable 5.2 8228c3649c Pattern Stamp: Behind in the Mode list, painting only where the layer is transparent (#12879)
The Pattern Stamp's Mode list gets Behind right after Dissolve, in the
options bar's dropdown and the Shift+right-click menu, with no Clear. It
is greyed on the Background in the menu, lives in the tool's own brush
(tools.setBrush, as the Brush's), and picking another mode leaves it, by
the menu, the dropdown, the wheel or the blend keys. Shift+Alt+Q picks it.

paint.patternStamp takes "mode": "behind": the pattern goes beneath the
layer's pixels with the Brush's Behind arithmetic, so opaque pixels are
unchanged and transparency is filled, Aligned on and off, Impressionist
too. Locked transparency and targets without alpha take nothing. The live
stroke lays the same pixels as the commit. Every other mode paints as
before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 23:03:45 +01:00
David Mann ec40f3912a Merge pull request #12882 from Bobderto/codex/12829-freeform-history
fix: record Freeform Pen strokes with their tool name
2026-11-10 22:14:53 +01:00
David Mann 3cc12bcb2b Merge pull request #12969 from Bobderto/codex/12936-bracket-size-steps
fix(engine): follow Photoshop bracket-key brush size steps
2026-11-10 22:14:13 +01:00
David Mann 72e17777bc Merge pull request #11170 from DingusMcRinkyDinky/warp-fold-layers
Warp: a fold shows what's under its transparent parts
2026-11-10 22:14:00 +01:00
David Mann c76cc5b5ad Merge pull request #12998 from rmsff/fix/sharpen-refuses-indexed-12953
Sharpen: refuse Indexed Color and Bitmap documents
2026-11-10 21:46:48 +01:00
David Mann ecfa246f80 Merge pull request #12987 from Bobderto/codex/12881-pattern-stamp-origin
fix(paint): match unaligned Pattern Stamp origins
2026-11-10 21:21:56 +01:00
David Mann d6ead54a81 Merge pull request #12954 from rmsff/fix/object-selection-mode-refusal-12867
Object Selection: refuse Indexed Color and Bitmap documents
2026-11-10 21:21:45 +01:00
Michael Higginsandkayrockscreenprinting 6a676ee1be Save over a flat JPEG: JPEG Options, then in place; transparent ones offered as PNG (#2223)
Fixes #2223. Carries the in-place flat Save of #5865 (closed as superseded by this PR) and revives what #2515 (@kayrockscreenprinting, closed when its author stepped away) added beyond it.

File › Save now writes back over a flat file when that file still holds the document: one plain opaque layer the format can store, and only when the file held a single image. A JPEG (and a TIFF, Targa or DDS) asks its format options first, as Photoshop does; Cancel writes nothing. A JPEG whose lone layer has transparency it can't keep is offered as a PNG. Multi-image files (animations, multi-page TIFFs, multi-size icons, multi-part EXRs) still go through Save As; the source image count is kept through crash recovery.

Co-authored-by: kayrockscreenprinting <257643019+kayrockscreenprinting@users.noreply.github.com>
2026-11-10 20:26:48 +01:00
RickiNano 4af62e8abb fix(ui): Delete on an anchor selected with Add Anchor Point removes it, not the layer (#12703) (#12796)
* fix(ui): Delete on an anchor selected with Add Anchor Point removes it, not the layer (#12703)

With the Add Anchor Point tool and one anchor selected (Ctrl+click), Delete
and Backspace fell through to Edit > Clear and deleted the active layer.
They now remove the anchor and its two segments, as in the reference
application: a closed subpath opens there. One history step, Delete Anchor
Point.

- vector: edit::delete_anchor_and_segments (a closed subpath opens at the
  anchor; an open one loses an end or splits at an inner anchor)
- engine: path.deleteAnchor takes "segments": bool (default false keeps
  joining the neighbours, as the tool's click does)
- ui: delete_key_deletes_anchor next to delete_key_deletes_work_path, and a
  Delete/Backspace branch before the work path's

* test(vector): Delete on one anchor of a closed two-anchor subpath leaves the other, open (#12703)

The kept anchor retains its handles and smooth flag, and the subpath keeps its path operation.
2026-11-10 20:08:21 +01:00
Vlad Grankovsky 333566a616 Merge upstream main 609e2aa72 into curves follow-up 2026-11-10 19:51:17 +01:00
rmsff cbff770f0e Test the Sharpen tool's Indexed Color and Bitmap refusal
Makes the Dodge refusal tests' session, steps and pixels helpers
pub(super) and reuses them.
2026-11-10 21:03:11 +03:00
rmsff 3b5a62e75f Sharpen: refuse Indexed Color and Bitmap documents (#12953)
paint.sharpen and its live stroke fail with the reference application's
alert text, and a press with the Sharpen tool opens that alert, as the
Dodge tool does since #12686.
2026-11-10 21:03:11 +03:00
FredApps 96581039a8 Merge main into feat/ui-217-4-columns-unit 2026-11-10 18:41:49 +01:00
David Mann 609e2aa727 Merge pull request #12883 from rmsff/fix/warp-split-default-thirds-12495
Warp: a one-way split on the Default grid keeps only the thirds across it
2026-11-10 18:38:59 +01:00
Dan ea771f39e0 fix(paint): match unaligned Pattern Stamp origins 2026-11-10 17:29:12 +00:00
rmsff 56d14fdf63 Test the History Brush colour mode and bit depth refusals 2026-11-10 20:04:22 +03:00
rmsff 56d12096d6 History Brush: refuse a source of another colour mode or bit depth
After Image › Mode, Photoshop refuses to paint from an older state in the two cases measured for this tool: RGB to Grayscale ("Could not use the history brush because the current color mode does not match that of the history state.") and a bit depth change ("...the current bit depth does not match that of the history state."). Refuse the same way, after the canvas size check, in history_source so the live stroke preview refuses too.

Every other change (RGB to CMYK, Lab or Indexed, a non-RGB source, the mode and the depth at once) was not measured and keeps today's behaviour, as do the Eraser's Erase to History, the Art History Brush and Fill › History (#12842).
2026-11-10 20:04:22 +03:00
2ec3ecf243 Type: render a paragraph-box handle drag off the UI thread (#7032) (#12316)
* Type: render a paragraph-box handle drag off the UI thread (#7032)

While a box handle is dragged the document is left alone: each move
records the wanted box, a worker lays out (holding the shared text engine
only for layout) and rasterizes a copy of the layer, and the canvas shows
the document with the newest finished render. One render runs at a time
and the latest box wins. Releasing, committing or any other end of the
drag applies the box with the same type.edit as before, so the final
document and its single history step are unchanged. Without background
jobs (web, tests, scripts) every move still runs type.edit.

* Address review: end a box drag before other commands, on a stale preview and for Type Mask edits

- A command other than a view command (Free Transform, a menu item, a
  shortcut) applies the dragged box and ends the drag before it runs.
- A preview gone stale (the document changed some other way) ends the
  gesture instead of applying the press-time box over that change.
- Type Mask edits keep the synchronous drag: their overlay is drawn from
  the document's layout.
- apply_box keeps the stored size finite and documents its units.
- Tests: a width drag that rewraps, each of the above.

* Address review: Free Transform and Save mid-drag see the dragged box

UI_COMMANDS is every shell-handled command, not only view ones, so the
exemption skipped edit.freeTransform and file.save. Only view., window.
and help. commands now leave a box drag going. Adds a Free Transform test
and requires a box shape when the huge-box edit succeeds.

* Address review: the Free Transform test checks the command succeeds and its frame is the resized layer's

* Address review: only listed view commands leave a box drag going

view.clearSelectedGuides edits the document, so a prefix exemption for
view. commands let it make the preview stale and lose the dragged box.
The exemption is now an explicit list of commands that change nothing in
the document, and a test covers the guide command.

* Address review: switching documents, engine.execute and app.save end a box drag first

- window.* commands are no longer exempt: window.nextDocument and
  window.previousDocument switch documents mid-drag.
- The control channel's engine.execute (engine commands) and app.save
  bypass menus::invoke, so they end the drag themselves.
- Tests: a control engine.execute and app.save mid-drag, and a document
  switch mid-drag.

* Address review: panel toggles leave a box drag going

Opening or closing a panel (Cmd+T toggles the Character panel while
typing) only lays out windows, so window.panel.*, window.toggle.* and
type.panels.* no longer end a drag. A test covers three of them.

* Address review: doc comments on the functions this change touches

CodeRabbit's docstring coverage check was at 73.68% against 80%. Adds a
doc comment to each touched function that had none: the new helpers and
tests, and the existing functions this change edits.

---------

Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 17:38:56 +01:00
Khawar Zamman WaniandFredApps b0a4fdeeca Transform presets flip the targeted vector mask (#12283) (#12330)
* Fix targeted vector mask flips via path transform (#12283)

* Target vector masks explicitly in path transforms

A shape layer's path is its content, so path.transform's layer target
took the shape path even when the layer's separate vector mask was
targeted. Add an explicit vectorMask flag to path.transform and have the
Transform presets use it, leaving the shape path and cache alone.

The UI's vector-mask target now yields to an active alpha channel or
Quick Mask, and an explicit target in the params still wins. Add engine
and UI regressions for the shape-plus-mask case and undo/redo.

* test(ui): fix vector-mask target precedence fixture

* chore: restart CI after wasm-bindgen download timeout

* fix: respect vector mask locks and cover rotation presets

* fix: guard implicit vector mask path transforms too

---------

Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-10 17:38:49 +01:00
David Mann c797e56f67 Merge pull request #12951 from rmsff/fix/art-history-mode-mismatch-12826
Art History Brush: refuse a source of another colour mode
2026-11-10 17:37:05 +01:00