The tests built the expected explorer.exe / reg.exe path from SystemRoot with unwrap(),
so they panicked when it was unset and ignored the C:\Windows fallback for an unset or
relative value. The rule is now a small pure function windows_root(value) in each crate;
the tests use it and check the absolute, unset, relative, rooted-without-drive and empty
cases without touching the process environment.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reveal in Explorer and the CJK locale lookup started `explorer` and `reg`
by bare name, and Windows looks in the app's own folder first: an
explorer.exe or reg.exe next to a portable PhotoCraft ran instead.
Both now start from %SystemRoot%.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Localization keys such as $$$/Presets/Shapes/Tiger=Tiger were kept raw, so the Shapes panel showed the key. File → Open now reports the group the importer stored, including a suffix when that name was already taken.
Review (CodeRabbit on #9618): deserialising the whole performance section strictly meant one
wrongly typed value (say "cacheLevels": "four") reset Graphics Adapter to automatic at startup,
while the app, which loads the file through read_lenient (#6611), kept the user's adapter.
read_display_server had the same flaw.
prefs::read_section exposes the engine's lenient reader for one section; gpu_startup's
read_performance uses it for both the graphics adapter and the Linux display server. Tests: a
valid adapter and display server survive a malformed sibling value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Color panel's mode, ramp, Web-safe ramp and edited chip were never
saved, so every launch reset them. They now live in the preferences
(colorPanel), written when they change and restored at launch next to
the dock layout, independent of workspaces.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Layers copied to another document were fitted to its mode, depth and
canvas but not its resolution: a type layer kept the source's point
size and box, so its next text edit re-laid it out at the destination's
dpi (24 pt from 72 to 300 ppi grew about 4.2 times). adapt_copies, used
by copy-to-document and paste, now applies the same compensation as an
Image Size resolution change (canvas_geom::set_resolution).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Image > Adjustments > Equalize with an active selection now opens a dialog
with Photoshop's two choices. Equalize Selected Area Only, the default,
changes only the selected pixels, as Equalize did before. Equalize Entire
Image Based On Selected Area maps every pixel of the layer within the
canvas by the selected pixels' histogram.
image.adjustments.equalize takes selectedAreaOnly (default true), and a
script that passes it runs without the dialog. .atn save writes the Eqlz
step without this setting, so it refuses a step with selectedAreaOnly false.
- Remove blank lines between doc comments or #[test] attributes and the item (S8855, S8856)
- type_tool: drop the redundant else after continue in the IME event arm (S8862)
- ui_state: pass OsStr::to_os_string instead of an equivalent closure (S1612)
- macos packaging: [[ ]] for the attempt test (S7688); bind validate_staple's argument to a local (S7679)
* chore: resolve SonarCloud maintainability issues
* fix: format imports and fix effect_entry argument type
* fix: restore test closure and wildcard import that broke compilation
* refactor: split composite_to_surface to reduce cognitive complexity
Clone strokes painted every dab where its points lay, up to 1e7 px off
the canvas: on the layer itself without "newLayer", and on the work
surface with it, so each far dab allocated up to 4096x4096 px of tiles.
A stroke with points [[100,100],[-30,100],[9e6,9e6]] on a 200x200
canvas painted 3 dabs and left pixels left of the canvas. The dabs are
now cut to the canvas before any read or write.
Found by CodeRabbit on #9386.
Co-authored-by: Valentin Klein <271991477+vangel76@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(updates): startup update prompt modal and direct self-updating
Release checks and the install go through craft-update's Updater: the engine's Help ▸ Check for Updates command keeps its status machine, its transport asks craft-update instead of a private GitHub client, and a found release opens the startup prompt. An install holds back while documents are unsaved, and a finished update closes through the guarded close path. craft-update stays out of the wasm build.
Ref: storytold/craft-libs#319
* fix(updates): address review feedback
Wake the UI when a manual check is queued from a menu callback; the update prompt owns the keyboard while it is open (LightCraft); Download opens through the desktop URL hook (FilmCraft); the Help menu dispatches through menus::invoke (FigCraft); print jobs and comment drafts hold an install back (WordCraft); Check for Updates is a registered command (GridCraft); an install holds back while documents are unsaved.
Conflicts: the batch's wheel reads (#5547 Animated Zoom) keep their extra
argument with main's ids (`Id::unique`, `ui.scope_id()`); crop presets keep
#6620's `apply_choice` with main's accessible name; Bevel & Emboss keeps
#9370's per-mode id with main's name argument; the Stroke field keeps
#7203's gradients with main's name; tone.rs keeps #9139's move of the
Histogram panel to histogram_panel.rs (main only renamed ids there);
translation catalogs as unions.
Not flagged by git, the batch's new code follows egui 0.37 too: dropdowns
take an accessible name (Histogram Channel/Source #9139, tool Mode #5504,
Art History Style #1610, New Snapshot From #3567), MouseWheel events carry
`source`, `WidgetType` is `Role` (ColorButton is ColorWell, #7203),
`Id::new`/`Ui::id` are `Id::unique`/`Ui::scope_id`.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* egui037: name each control for what it sets, and order the eager fonts for the UI
CodeRabbit review follow-ups on the migration: the Artboard X/Y fields, the CAF
dropdowns, the channel Solidity field, the GPU backend/adapter dropdowns, the
corner radius fields and the canvas extension colour all had an accessible name
that named another control (or was shared by four). The eager craft-fonts
registration now puts the UI Japanese face first, as the lazy loader does, so
Japanese UI is not drawn in the manifest's Mincho face and shared Han characters
do not take Japanese forms.
Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
* egui037: rustfmt the eager craft-font order
---------
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
Co-authored-by: Codebuff <noreply@codebuff.com>
- Each tile still copied a source window of (tile +- halo) clipped to the
dab bounds, but a rotated read can land up to a dab diameter away: a
leftward drag [[110,40],[20,40]] at size 40 read empty pixels at x = 64
(seam), and a large click still copied about the whole dab per tile.
The stamp now samples the history state directly (no window, no
StampParams::halo), and bilinear reads at pixel centres, so an
unrotated dab copies the history pixel instead of a 2x2 blend.
- Tolerance compared colour only, so an erased patch (the Eraser keeps the
colour, lowers alpha 1 -> 0.6) was skipped at tolerance 25: the
difference is now the larger of the mean colour change and the alpha
change.
- The brush had its own history lookup (row 0 unless `state` was passed):
it now uses the History Brush's source (history.setSource, snapshots,
redo rows, refusal after a canvas size change).
- A stroke that wrote nothing at tolerance 0 (wholly outside the
selection, or on Lock Transparency over transparent pixels) failed
with "no stroke points"; it is now the same quiet no-op as a stroke
under the tolerance (damage null, no History step).
- A mode other than Normal (agents only: the options bar sends none)
blended each dab with the already-mixed result at full strength, so
Multiply with a white source over 0.5 grey fell to 0.33 five pixels
from a dab's centre instead of staying 0.5. Other modes are refused
until the stroke is buffered, and the wrong path is removed.
- TOOL-213-20 is partial (8 of 10 styles, Area scales spacing); docs follow.
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Opening a 2.14 GB PSD (2000×2000, 109 layers, 821 MB of embedded smart objects) peaked at
7.28 GB and took 6.8 s; it now peaks at 3.00 GB and takes 3.6 s (macOS peak memory footprint,
`cargo run --release -p photocraft-io --example psd_open_mem`).
- photocraft-psd: `PsdFile::from_source` parses from a `ReadAt` source (`FileSource`: pread /
seek_read in bounded reads). Channel data and the merged image become `Stored` ranges read
when decoded; the model equals `from_bytes`'s and writes back the same bytes (tests compare
the two on every generated file, including Lr16/Lr32 layer blocks and truncated files).
- `ChannelData::row_decoder` decodes any band of rows: RLE via its row table (a stored channel
reads only the band's bytes), raw by offset, ZIP inflated once.
- photocraft-io: `import_file` opens a path; PSD/PSB through `from_source`, other formats read
whole. Layers decode in bands of whole tile rows (~32 MB) into tiles: no whole-layer plane or
interleaved buffer. Global blocks move into the document instead of being copied; finding an
embedded smart object no longer copies every file in `lnk2`.
- photocraft-raster: `Surface::share_uniform_tiles` + `TileInterner`; the PSD import shares
single-value tiles (backgrounds, fill caches, masks) across layers.
- The background open job and the CLI/MCP (`automation::files::open`) use `import_file`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adjustment layers (compose blend_back), destructive edits
(mix_through_selection) and plug-in filters mixed their result back as
o + (r - o) * k. In f32 the difference had already rounded a small
result away against a huge backdrop, so a Color Lookup's 0.1 over 2^20
came out 0.125, and 0.5 over 1e8 came out 0. They now compute
o * (1 - k) + r * k, which is exactly r at full coverage.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stamp now reads each dab's bounds plus one pixel, but the coverage
check still inflated the stroke bounds by the full halo, so a single
Loose Curl click of size 1400 or more on a 2600x2600 canvas failed with
"stroke too large". Inflate by one pixel instead, and add a test for
size 2000 Loose Curl and size 2400 Tight Medium clicks.
Also make the documented tolerance default match the engine's (0).
Photoshop has no general animation setting (its only motion settings are
Animated Zoom, Flick Panning and Overscroll in Preferences > Tools), so
Preferences > Interface > Enable animations goes:
- interface.enableAnimations leaves the prefs model. Saved files that
still have it load whole (unknown keys are ignored, nothing is reported
as invalid); prefs.set/prefs.get on it are "unknown preference" errors.
- sync_animations is gone: egui's fades and scroll-area glides keep
egui's defaults everywhere.
- The canvas wheel pans without egui's glide, as Photoshop does
(measured: one notch moves the view in a single frame, nothing after).
The unsmoothed pan now folds Shift and Cmd/Ctrl sideways the way egui
does, so Ctrl+wheel still scrolls sideways (the old Enable animations
off path dropped it). Liquify and Camera Raw previews keep read()'s
smoothed pan, so read_with keeps its smooth parameter.
- The label leaves the 20 i18n catalogs; scorecard UI-217-10 no longer
lists an animation toggle; docs/scorecard.md regenerated.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>