Commit Graph
228 Commits
Author SHA1 Message Date
aiongg ed14e1c413 PhotoCraft on the craft UI framework (#15449)
PhotoCraft's UI moves onto the shared craft UI framework in storytold/craft-libs (next branch): shell, dock and panels, hosted dialogs, keyboard, focus, IME and pointer routing, the canvas's view commands, themes and tokens. The engine, document model, file formats, commands and automation stay. PhotoCraft pins storytold/craft-libs next.
2026-11-17 10:41:35 -05:00
hnoerenberg d98386f43b test(engine): import craft_psd in the gaussian edge profile test
The shared PSD crate is craft_psd now. The test still imported photocraft_psd, so the engine test target did not compile on a merge with current main.
2026-11-16 08:25:49 +01:00
hnoerenberg 0b6c9d6700 Merge upstream/main into fix/gaussian-blur-edge-parity-11528 2026-11-15 16:27:43 +01:00
Dylan M. Taylor 13fe2864af Fix CI formatting, clippy, scorecard, and format routing regressions 2026-11-14 04:52:59 +00:00
Dylan M. Taylor 8c7544ed2a Use craft-affinity from craft-libs; remove crates/affinity 2026-11-14 00:16:50 +00:00
Dylan M. Taylor 040962a5b4 Merge photo-cms-port: use craft-cms and remove crates/cms (#13393) 2026-11-14 00:02:22 +00:00
MarekSpodBiedryandskylar 8631a92178 Rasterize: undo the layers already converted when a later step fails (#4974) (#5073)
* Rasterize: undo the layers already converted when a later step fails (#4974)

* Rasterize: roll back through the shared compound helper when a later layer fails (#4974)

* Test that a failed Rasterize keeps a clean document clean (#4974)

* Rasterize: undo the layers already converted when a later step fails, and refuse before a step starts when there is nothing to do (#4974)

* Format the rasterize rollback tests

* Rasterize: cover the All Layers and Layer Style refusals through the real commands

* Rasterize: name the history step after the variant, and test the rollback through the real commands (#4974)

---------

Co-authored-by: skylar <[email protected]>
2026-11-13 01:16:51 +01:00
Dylan M. Taylor 74330157cb Use craft-psd for PSD/PSB format code (#13414)
* Use craft-psd from craft-libs; remove crates/psd

* Regenerate the scorecard (28 crate roots)

* Take craft-psd at craft-libs 55d120f2

* Regenerate lockfile for current shared format crates

* Pin shared format crates to current craft-libs main

* Match brush import cap to shared decoder budget

* xtask: update layer fixtures after PSD extraction
2026-11-12 02:53:54 -05:00
Dylan M. Taylor 2b75a0092d Use craft-cms from craft-libs; remove crates/cms
craft-cms was extracted from crates/cms (storytold/craft-libs#779), and both
copies changed afterwards. storytold/craft-libs#PRNUM ports the 41 commits made
here since the extraction, so the shared crate now has everything this copy
had, and PhotoCraft depends on it.

craft-cms returns errors where the local crate panicked on caller input:
transforms, tables and LUT constructors return Result. Call sites propagate
the error where the function already returns one, and fall back where the
arguments are fixed by construction (each with a comment saying why).
Lut3d's fields are private there; the proof and HDR display table is built
with Lut3d::from_fn.

The pin is the head of the craft-libs branch and moves to main when that
pull request merges.
2026-11-11 19:41:51 +00:00
Tanish Manku 28d2b499b5 Merge pull request #11062 from yoriswind/codex/artboard-move-overflow
Reject cross-artboard moves whose required translation overflows
2026-11-11 00:27:05 -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
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 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
Vlad Grankovsky 333566a616 Merge upstream main 609e2aa72 into curves follow-up 2026-11-10 19:51:17 +01:00
Hector Villarreal 7b20000052 Grayscale swatch through sGray, as agreed on the PR (#11940)
The reference's Eraser paints 173 for background RGB 0,200,0 in a Grayscale
document; the document's Dot Gain curve gives 153, so swatch_in_doc now
converts through the sRGB tone curve (sGray, 172-173) instead. Pixel
conversions keep the document's profile. The two Grayscale tests are no
longer ignored, and eraser_locked's Gray case checks the sGray value, since
the Brush's own conversion into Gray (not measured) is unchanged.
2026-11-10 08:37:07 -06:00
437cd7f0fe fix: brush hints keep a feathered mask's ring and the effects' reach (#9329) (#10104)
* fix: brush hints keep a feathered mask's ring and the effects' reach (#9329)

A command's damage hint (the bare dab) was intersected with the edit's
own damage, which `tile_damage` had grown by the mask's feather and the
layer's and enclosing groups' effects. The intersection cut that growth
off, so painting on a feathered layer mask left a stale soft ring around
each dab, and a dab's drop shadow was outside the reported damage.

`hint_damage` now grows the hint by the same rule first (`grow_hint`,
sharing `grow_in_layer` and `effects_reach` with `tile_damage` and the
group walk). The hint is still checked against the changed tiles as is.

The group-shadow test now cuts a hole at a tile's right edge, so its
shadow crosses into the next tile (it passed without the group's growth
before), and the clip-base test gains a dab at a tile edge.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix: brush hints skip the effects of layers that aren't drawn (#9329)

`grow_hint` grew a dab by the effects of every layer in the document,
hidden ones included, so a large drop shadow on a hidden layer widened
every `paint.stroke` dab elsewhere to all the tiles `step_damage`
reported, and each dab recomposited and uploaded that much.

It now skips layers the compositor skips, by the same rule as
`effect_layers`: a hidden layer, a clipped layer over a hidden base, and
everything inside a hidden group. A change there shows nowhere, and
every drawn layer still grows the hint as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test: the group-shadow brush test goes through the hint (#9329)

`a_dab_inside_a_group_with_a_drop_shadow_damages_the_shadow` painted
with a plain `Session::edit`, so its damage came from `step_damage` and
never exercised `grow_hint`. It now paints with `paint.stroke`, and the
child carries a shadow of its own inside the shadowed group: the group's
shadow of the child's shadow lands past either shadow's reach alone, in
the next tile, so dropping the enclosing groups' reach from `grow_hint`
fails it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: FredApps <[email protected]>
Co-authored-by: FredApps <[email protected]>
2026-11-09 16:36:58 +01:00
Eng. Mahmoud Bek ElNemer 5fa708967f fix(engine): drop selection after masking a live Gradient Fill layer
Fixes #12196
2026-11-09 05:07:35 +02:00
Vlad Grankovsky 3d57a9afeb Merge upstream main 6ab991571 into curves follow-up
Keep recorded channel initialization shared with Record Again and retain upstream Photo Filter and Action playback behavior.
2026-11-08 14:13:01 +01: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
7f09b2013d Merge current main into #9077 (Average on Smart Objects)
Resolves the status-line conflicts in docs/gaps.md and
docs/target-app-parity.md (both sides kept) and the module list in
crates/engine/tests/it/main.rs.

Co-Authored-By: arjen <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 18:48:12 +01:00
yoriswind 6e38ee5760 Reconcile Artboard overflow tests and documentation with current main 2026-11-06 20:16:57 -08:00
Vlad Grankovsky 283de2c506 Merge upstream main 8df2b7a2e into curves follow-up 2026-11-07 01:27:10 +01:00
yoriswind 2e210c0aae Scope Actions tool recording guard to the active take 2026-11-06 13:40:05 -08:00
yoriswind 5f480238d0 Reconcile five Classic Actions commands with current main 2026-11-06 09:29:48 -08:00
FredApps aee46a2fc6 Merge remote-tracking branch 'origin/main' into fix/10164-final-prune-u2 2026-11-06 17:28:48 +01:00
David Mann ec5eb1e2d0 Merge commit 'refs/fixprs/main' into HEAD 2026-11-06 10:21:59 +01: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
David MannandClaude Opus 5.5 99b93f82da Batch 18 (CodeRabbit nitpicks): crop test checks the active layer's covered pixels; Esc test goes through the shortcut handler
- #11458: the straight-crop rows also check that the active layer's pixels
  inside the old canvas are the plain crop's, so a fill that recolours them
  fails.
- #11295: the Esc case sends the key through shortcuts::handle instead of
  calling cancel directly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 04:04:26 +01:00
yoriswind d58701ddff Merge current main into the Actions preservation candidate 2026-11-05 18:31:30 -08:00
yoriswind 84c41c5f10 Limit Actions panel changes to the five reviewed commands 2026-11-05 17:13:15 -08:00
David Mann d563b3100b Merge commit '9bef3b2dc8b84c1b6cefc8ce0dc2b01d089cd9e8' into HEAD
# Conflicts:
#	crates/engine/tests/it/svg_smart_object.rs
2026-11-06 01:46:48 +01:00
ArjenS-LA a38fc6ff5b Refresh Average Smart Filter stack and verify selection and channel values 2026-11-05 15:53:24 -08:00
David Mann 1d053f5c2c Merge PR #11495: Actions: play recorded Stack Modes and Video Frame events 2026-11-06 00:28:47 +01:00
David Mann 1d5c69dda4 Merge PR #11458: Crop: fill the active layer and Background with Content-Aware Fill 2026-11-06 00:28:41 +01:00
David Mann f96e77e794 Merge PR #11553: Actions: replay recorded Perspective Warp steps 2026-11-06 00:28:38 +01:00
Hartmut Nörenberg f7e6e7249c test(algo): pin the Gaussian blur edge profile and its ATN identity
#11528 measures Photoshop 27.11 against PhotoCraft on an opaque black/white
step at radius 2.3 and finds up to 8 of 255 levels between them, at both
depths. Our row is exactly what a Gaussian sampled at whole pixels with
sigma = radius and a 3-sigma window produces (deviation 0 against a plain
model of that kernel), so nothing in the pipeline rounds or clamps wrong: the
gap is the radius-to-blur mapping, and no mapping is determinable from the
published numbers - Photoshop's own three radii imply factors of about 0.88,
1.08 and 0.97, while box-pass and truncation families fit worse than today's
kernel does.

So pin the behaviour instead, with a ratchet: the 8-bit and 16-bit rows across
the edge, the distance to Photoshop's measured rows (may shrink, may not
grow), and that a GsnB action replay renders the same bytes as the direct
command at both depths. A future mapping change then has to be a decision with
a number attached to it, not a silent edit of a kernel.
2026-11-06 00:17:30 +01:00
e55e2f3577 Place decodes and fits in the background: dropping a large file no longer freezes the window (#10147)
* Place decodes, fits and renders in a background job

File > Place Embedded / Linked started with Session::start, and
Session::start_place_bytes for bytes with no path, now run the decode,
flatten, resize and SVG render on a worker (prepare_place) and insert the
layer when the job is applied (apply_place). Inline callers (execute, the
CLI, headless MCP, actions) behave and return exactly as before. Part of
#10031.

* Dropped and placed files no longer freeze the window on desktop

With background jobs on, File > Place and files dropped on the canvas start
the place as a job (JobsUi.place). Free Transform begins when the layer has
landed, a failed or cancelled place is reported and the drop queue goes on,
and a drop that arrives meanwhile waits for it. The place shows its progress
in the status bar instead of the modal dialog, so the view stays usable.
Part of #10031.

* Tests: compare place job results without the layer id

Layer ids come from a counter shared by every session, so a job and an inline place in two sessions never get the same one.

* Dropped files stay with the document they were dropped on

Each queued canvas drop now carries its document's id. A file is placed
only while that document is active: files dropped on a document in
another tab wait until it is back in view, and are discarded with a
message when it is closed. Web drops, read by the shell after the drop,
go to the document the drop landed on.

Before, the next queued file went into whichever document was active
when the previous place finished, failed or was cancelled, in the
background and inline paths alike.

* Remove the unused file_open import

* fix: address background placement review feedback

* fix: preserve drop targets and interrupt placement pixel stages

* fix: qualify placement inbox document identity

* test: wait for background placement in app drop regression

* fix: retain queued drops while external document jobs run

* test: clone rendered pixels from drop-managed buffers

* test: cover band rows channels and queued-drop resumption

* Place decodes and fits in the background: dropping a large file no longer freezes the window

Placing a file decoded, flattened and resized on the UI thread; a large PNG froze the
window for seconds (#10031). `place_bytes` is split into a session read, `prepare_place`
(decode, flatten, fit, translate, SVG render at placement scale) and `apply_place`, and
runs through `jobs::run`, so File › Place and canvas drops run on a worker with progress
and cancel. The window follows the job: status-bar progress, Free Transform when the layer
lands, and drops queued per target document.

Review fixes on the way:
- a path and byte drop queue entry records its target DocId, so files dropped on one
  document never land in another after a tab switch, and closed documents discard theirs;
- the closed-document notice stays up for a frame instead of being cleared by the next
  queued placement;
- the queue is bounded (32 files / 256 MiB) so drops waiting on another tab cannot grow it
  without limit;
- flatten and resize stop at the job's interrupt, and a place skips the modal progress
  dialog only when the status bar actually shows its progress;
- the placement's `doc` is kept only for SVG input, through the importer's `is_svg_input`;
- the interrupted-composite test uses an opaque fixture that varies by row and channel, and
  checks the composite against the layer's stored pixels.

* Place reads its file in the job, and refuses a huge canvas as before

file.placeEmbedded and file.placeLinked read the whole file in the
command before the job started, so a path dropped on the canvas or
picked in File > Place still blocked the window for the read. The place
now carries the path and reads it in prepare_place: on the job's worker
in the background, on the calling thread inline (wasm, background jobs
off), with the same read_file limit and error text. Whether the source
is a vector one is decided once it has been read.

The job's flatten check returned Other("the document canvas is too large
to flatten"), where the place used to give flattened_checked's
BadParams for file.place naming the canvas size. Both now share
check_flattenable, so the old error type and message are back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Path drops aren't capped, and a discarded drop wakes the queue

The 32-file cap on the drop queue counted path drops, which hold no
file contents while they wait, so dropping 40 files on the canvas
placed 32 and refused 8 where main placed them all. The count cap now
applies to browser drops only (each holds its whole file); the byte
budget still bounds those.

When place_next_dropped discarded a closed document's files it returned
without asking for another frame, so another document's queued files
waited for the next input event. It now requests a repaint when files
remain, keeping the one frame that shows the notice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: FredApps <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-05 22:49:52 +01:00
yoriswind 8bc5399652 Keep unknown Stack Mode None descriptors inert 2026-11-05 12:57:30 -08:00
yoriswind 19ac2452a0 Merge Batch 17 while preserving Crop fill and Artboard sizing 2026-11-05 09:15:36 -08:00
yoriswind 8a126888f3 Merge upstream main after integration batch 17 2026-11-05 09:09:02 -08:00
yoriswind 9f393ebeb5 Require the null class for edited Stack Mode None provenance 2026-11-05 08:50:31 -08:00
yoriswind b6bb43bc19 Handle edited Stack Modes and cap video frame growth 2026-11-05 08:48:40 -08:00
yoriswind fbccaaeabb style(actions): apply Perspective Warp formatter 2026-11-05 08:40:04 -08:00
yoriswind 3feae0e0b6 Actions: map recorded Perspective Warp planes 2026-11-05 08:36:06 -08:00
yoriswind 05d3c0bf27 Support recorded Smart Object Stack Modes and video frame edits 2026-11-05 06:24:06 -08:00
yoriswind 04a3d0d295 fix(crop): bound the widened sampling read 2026-11-05 05:43:56 -08:00
yoriswind add3c72f91 fix(crop): keep Background fill for a donorless active layer 2026-11-05 05:37:55 -08:00
yoriswind 337794eadc test(crop): size turned controls for the minimum warp budget 2026-11-05 05:36:45 -08:00
David Mann f162c19e81 Merge remote-tracking branch 'origin/main' into integration-batch-17
# Conflicts:
#	crates/ui-egui/src/control/dispatch.rs
#	crates/ui-egui/src/control/params.rs
2026-11-05 12:44:02 +01:00
Khawar Zamman Wani e3ecd73569 feat(frame): rework the Frame tool's selection, handles and placement (#8920)
Thanks @wanikhawar — merging the Frame Tool rework.

Summary: Frame Tool selection/handles/placement now distinguish frame vs image (border / click / double-click and Layers thumbnails), with independent transforms, shape variants, Properties/options-bar stroke and fit commands, Convert to Frame, CLI/MCP `layer.frame.*` commands, native `.pcraft` persistence, and PSD export via editable groups + `pcFr` metadata (not Photoshop's native frame type). Tests cover selection, transforms, fitting, locks/hostile geometry, and native/PSD round-trips.
2026-11-05 12:39:02 +01:00