Commit Graph
2574 Commits
Author SHA1 Message Date
Gert Pellin - GPE ba40454b18 Logging: a second launch leaves the running instance's log alone (#6432) (#6478)
logging::rotate renamed photocraft.log up the chain on every start without
knowing whether another instance still wrote to it. The running instance
kept its handle, so after a second launch its live log was .1.log, after a
third .2.log, and a fourth launch deleted it.

The instance that writes photocraft.log now holds an exclusive lock on
photocraft.lock until it exits (a separate file, since Windows locks are
mandatory and would keep the log itself from being opened). A start that
finds that lock held leaves the chain alone and writes
photocraft-<pid>.log, marked by photocraft-<pid>.lock. Those side-by-side
logs are pruned to the newest KEEP once their instances have exited; a
held one is never touched. Rotation and pruning run under rotate.lock so
two starts at once can't interleave. On a file system without locks every
start rotates as before.
2026-10-17 11:57:39 -06:00
skylar taylor-barrick 8c12449819 Save: keep the replaced file's metadata (#6603, #7073, #7094, #7095, #7096)
Saving writes a temporary file and renames it over the target, so everything
attached to the old file went with the file that was unlinked. Several of those
are security decisions, so a save quietly undid them: a download lost its Mark
of the Web, an explicit ACL fell back to whatever the folder hands down.

New crates/format/src/atomic/meta.rs, reached from atomic_write through two
AtomicFs methods (copy_permissions became copy_metadata; replace_existing is new
and defaults to rename, so the failure-injecting test file systems are
unchanged):

- Extended attributes (#6603): flistxattr/fgetxattr/fsetxattr through safe
  rustix, per attribute, best effort. macOS Finder tags, com.apple.quarantine
  (the Mark of the Web's macOS counterpart) and Linux user.* all ride along.
  Attributes the system owns refuse to be written and are skipped;
  com.apple.decmpfs is skipped deliberately, since it describes storage the new
  bytes do not have.
- macOS ACL (#7073): a new macOS-only exacl dependency (MIT).
  fcopyfile(COPYFILE_ACL) is an unsafe fn and fclonefileat(CLONE_ACL) is
  APFS-only and would mean writing every save as clone-then-truncate; the
  reasoning is in docs/decisions.md. A file with no ACL is left alone.
- Windows (#7094, #7096): ReplaceFileW through winsafe's kernel feature (MIT,
  no dependencies, a safe wrapper; the workspace forbids writing the FFI call
  here). One call keeps the destination's DACL, its named streams including
  Zone.Identifier, and its creation time.
- Automation write path (#7095): AuthorizedWorkspace::write copies the replaced
  file's attributes through the two cap-std descriptors, never a path, so a
  request path still cannot escape the write root. Permissions there remain
  #4963; ReplaceFileW is path-based and so is not used on that path.

The order inside copy_metadata matters: attributes and ACL first, permission
bits last. Writing an attribute needs the destination open for writing, so
copying a 0444 mode onto the temporary file first locks you out of your own
temporary file. Covered by a regression test.

Atomicity is not weakened. The metadata step runs on the temporary file before
the swap, never touches bytes, and never fails a save. Windows is the one place
the swap itself changed, and a backup file name is passed because it is a
correctness requirement, not an option: ReplaceFileW without one documents
ERROR_UNABLE_TO_MOVE_REPLACEMENT as leaving the replaced file deleted and the
replacement under its temporary name, which is a failed save that loses the
user's document. With a backup name the same failure leaves both files alone.
ERROR_UNABLE_TO_MOVE_REPLACEMENT_2, the one error that does move things, is
unwound by hand; every other error falls back to the plain rename, i.e. to the
previous behaviour.

THE WINDOWS PATHS ARE UNVERIFIED ON WINDOWS. They were written and reviewed on
a Mac. The #[cfg(windows)] tests -- Zone.Identifier, a second named stream,
icacls output, creation time -- have never executed. They do compile and pass
clippy -D warnings against x86_64-pc-windows-msvc, which is as far as a Mac
gets. CI's Windows job is the first real run, and #7094 in particular (Mark of
the Web surviving a replace) is the whole point of the change and is the part
no one has observed working.

Tested on macOS: a real chmod +a entry and a real Finder tag both survive a
save (checked with ls -le and xattr, and as unit tests), plus a 64 KiB
attribute value, a read-only file, the mode, and the automation path.

Still open: Linux POSIX ACLs are not carried over (system.posix_acl_access is
not reported by listxattr, so it needs its own step; not part of these issues),
and macOS creation time is still reset by a save (that half of #6603 needs
setattrlist, which has no safe wrapper here).
2026-10-17 10:43:09 -06:00
denstu473 ceb826e270 fix(atn): map Apply Layer Comp steps by name (#7101) 2026-10-17 18:30:57 +02:00
David MannandClaude Opus 5.5 5d6e0331e3 Merge main into feat/tool-213-4-cam-preview-large
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-17 18:30:04 +02:00
David MannandClaude Opus 5.5 c5b1f7769a Merge main into fix/6539-lightness-track
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-17 18:21:07 +02:00
David MannandClaude Opus 5.5 0aa456edc3 Merge main into fix/6267-psd-hue-sat-sf
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-17 18:06:09 +02:00
David MannandClaude Opus 5.5 990f40391c Merge main into feat/history-snapshot-options
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 18:05:25 +02:00
David MannandClaude Opus 5.5 363462e8d2 Merge main into fix/6268-psd-perspective-warp-sf
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-17 18:03:47 +02:00
Jeremy YaoandClaude Opus 5.5 382082fd73 Merge branch 'main' into feature/animation-effects
Brings in 433 commits from main. Conflicts:
- scorecard/ui.toml and the generated docs/scorecard.md: main updated the
  UI-217-10 note (canvas dots and Home screen recents are done). The note keeps
  main's text with this branch's animation part; the doc is regenerated.
- crates/ui-egui/src/prefs_ui.rs: main split the section editor into
  field_visible and field_rows; the choice dropdown there now uses
  pref_choice_label again. Runtime keeps both new fields.
- contributors/people.toml: main's version (this branch no longer adds an
  entry).

Main also read the removed interface.enable_animations for its canvas
no-glide change (#5883); the canvas now passes the resolved setting. Spanish
gained the same "On" entry on main, so this branch's copy is dropped, and a
test here follows wheel_nav::read's new parameters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 11:18:13 -04:00
ebosido444-ai fcd337e1fc perf(text): rasterize a type layer's pixels on all cores, bit for bit the same
A type render spends most of its time after the glyphs are drawn: composing each
colour's coverage over the premultiplied accumulator, dividing it back to straight
colour, and converting the tile bytes. All three are per pixel - no pixel reads a
slot another wrote - so they ran one after another on one core for no reason.

Measured on a 3.75 MP paragraph (4000 characters, 14 pt at 300 dpi, 1851 glyphs),
release, Windows 11, i5-10300H: rasterize 98.3-103.9 ms before, 60.3-61.8 ms after
(1.6-1.7x). Whole-render stage profile before: ink rect 4.1, draw 18.6-22.9, prefix
sum 7.0-8.1, composite 22.6-33.4, unpremultiply 11.2-14.0, write_region 23.8, prune
3.1 ms.

The glyph drawing, the winding prefix sum and the ink-rect pass stay on one thread:
the first two carry a running accumulator across pixels, and the band split that
would keep them bit-identical costs a second glyph traversal per band.

Native only (rayon, as the other crates): the web build keeps the serial loops.
2026-10-17 17:42:50 +03:00
Khawar Zamman Wani d182b2de15 Merge remote-tracking branch 'origin/main' into field-wheel-5473
# Conflicts:
#	crates/ui-egui/src/widgets.rs
#	docs/ui-parity.md
2026-10-17 19:44:20 +05:30
David MannandClaude Opus 5.5 e1c119200b Automation: place and layer/data-set export by index keep the active document (#7025)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 15:37:18 +02:00
abc2cbandClaude Opus 5.5 85760b1c36 PSD Wave smart filters: keep more than 64 generators verbatim
The Wave renderer clamps the generator count to 64 (the command allows up
to 999), but a Photoshop Wave with Scale 100% mapped to filter.distort.wave
whatever its Number of Generators. A file with 332 generators opened as a
supported, editable Wave and, once its cached pixels were re-rendered,
drew 64.

Treat it like a scaled Wave: a Wave with fewer than 1 or more than 64
generators stays Photoshop's, descriptor kept verbatim and written back
unchanged. The limit is photocraft_algo::MAX_WAVE_GENERATORS, which the
renderer now clamps to as well, so the two cannot drift.

Tests: the 332-generator Wave stays unsupported and round-trips its
descriptor; a new boundary test maps 1 and 64 generators and keeps 65, 999,
0 and -1 verbatim.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 16:24:48 +03:00
hogawish c907301d27 perf(canvas): skip occluded checker on CPU textures 2026-10-17 19:28:31 +09:00
Shubham Bhamare 1819e77c30 feat(i18n): add Hindi (hi) language catalog and locale resolution 2026-10-17 15:49:19 +05:30
Matthias Schlich c6fff8a3a8 Merge origin/main (up to a1e19a0b) into feat/psd-render-smart-filters
# Conflicts:
#	crates/engine/src/smart_cmds.rs
2026-10-17 12:10:28 +02:00
dotCooCoo a78e9f05fc Save: ask before replacing a file that an added or lowercased extension names
The save dialog asks before replacing only the file it answers with.
After it closes, pick_save can change that path: it gives a name
without an extension the suggested file's extension (#5039), and
Lowercase Extension changes CAT.PSD to CAT.psd. The save then wrote to
the changed path at once, and a file there was replaced without a
question. On Linux this happens when the Swatches panel exports to a
folder that holds Swatches.aco (the one-type portal dialog shows and
asks about "Swatches"), when CAT.PSD is typed where CAT.psd exists, and
in rfd's zenity fallback dialog.

When the path written differs from the dialog's answer and a file
exists there, the save now asks "“{name}” already exists. Replace it?".
Replace writes the file, and ui.dialog.confirm returns the save's
result. Cancel writes nothing and ends the save like the dialog's
Cancel, and Save in the close prompt of an untitled document returns
to that prompt. PhotoCraft counts the file dialog as open until the
question is answered.

A name that reaches the same file, as CAT.PSD and CAT.psd do on
Windows and macOS by default, is not asked about again. The new
same_file service decides this: the desktop app compares device and
inode on Unix and the canonical paths on Windows. The web has no file
stamps and does not ask. The two new strings have rows in all 20
catalogs.
2026-10-17 03:08:09 -07:00
abc2cb 538d9e0ece Merge branch 'main' into codex/github-smart-filters-usability-20261011 2026-10-17 12:13:35 +03:00
dotCooCoo 8f971cc79f Mixer Brush: Clean Brush empties the brush, and the automatic Load and Clean can be switched off
The Mixer Brush could not be emptied. MixerState::clean dropped only
the pickup well, paint.mixerBrush refilled the reservoir from the
foreground before every stroke unless loadAfterStroke was false, and
the app always sent the defaults. A stroke on a new layer over an image
always carried the foreground color, and the options bar had no Load
Brush or Clean Brush control.

Cleaning now empties both wells, so a clean brush lays down only the
color it picks up from the canvas. The new commands brush.mixer.load
and brush.mixer.clean load and empty the brush. paint.mixerBrush reads
loadAfterStroke and cleanAfterStroke from the brush and applies them
after the stroke. Both are on by default, and a stroke with both on
paints as before. A stroke whose color differs from the one recorded
by the last stroke, load or clean loads that color first. A load or
clean records the foreground, so choosing a new foreground loads the
reservoir.

The options bar has the Current Brush Load swatch, whose menu holds
Load Brush and Clean Brush, and two toggles for the automatic Load and
Clean. Brush Settings shows the same two options. The new strings have
rows in every catalog.
2026-10-16 22:49:47 -07:00
Korg1ch 4c881326ea fix(windows): keep crash-recovery autosaves out of the roaming profile (#5648) (#6412)
* fix(windows): keep crash-recovery autosaves out of the roaming profile (#5648)

* test(windows): cover the local recovery folder and moving old autosaves (#5648)
2026-10-16 20:19:06 -06:00
euisuhandOpenAI Codex f58107b505 docs: record Object Finder foreground detection fix
Document the boundary-based classification change and keep semantic segmentation explicitly open so the parity notes do not imply Photoshop-level recognition.

Closes #6548

Co-Authored-By: OpenAI Codex <noreply@openai.com>
2026-10-17 10:13:21 +09:00
Gustavo Ziger d900daa0ba fix(web): File › Place Embedded is enabled in the browser and places the picked file's bytes (#1209, #5749) (#5585)
With a document open in the web app, Place Embedded was disabled because its menu enablement inherited the engine's native-filesystem check, although the menu path reads the picker's bytes and never touches a path. Place Embedded is now enabled whenever a document and a file-dialog service exist; Place Linked keeps the engine's native guard, since the web could only link to a bare file name (caught in #5817 by Higgs32584). An enablement test runs with the native check forced off, and a file-dialog test covers the browser answer shape, cancel, invalid bytes and the Free Transform handoff.

Fixes #1209. Fixes #5749.
2026-10-16 17:38:56 -07:00
Davit Matchakhelidze 063eb8a997 Merge commit 'db46713c2ca0140e119956ed695cf92837fc50e3' into ka-language 2026-10-17 04:37:37 +04:00
David Mann 9d38b28da6 Merge remote-tracking branch 'origin/main' into feat/file-216-2-large-fixtures
# Conflicts:
#	docs/scorecard.md
2026-10-17 01:19:35 +02:00
David Mann 7e5e40e194 Merge remote-tracking branch 'origin/main' into feat/history-snapshot-options 2026-10-17 01:09:38 +02:00
David Mann 7b4b960faf Merge remote-tracking branch 'origin/main' into feat/history-snapshot-options
# Conflicts:
#	crates/engine/src/lib.rs
#	docs/scorecard.md
2026-10-17 01:09:38 +02:00
David Mann 0739ff48c5 Merge remote-tracking branch 'origin/main' into fix/4017-huge-new-document
# Conflicts:
#	crates/ui-egui/src/gpu_canvas.rs
#	docs/scorecard.md
#	perf/budgets.toml
2026-10-17 01:07:37 +02:00
Jason Xiang f61ed26e14 fix(io): honor version-aware OpenRaster group isolation (#5872) 2026-10-16 17:02:23 -06:00
MarekSpodBiedry 4c730d3889 Object Finder: hovering with an empty active layer shows the status-bar hint (#6549) 2026-10-17 00:10:17 +02:00
David MannandClaude Opus 5.5 8fc26b29de Merge main into feat/auto-219-8-panel-command-check
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 22:51:37 +02:00
David MannandClaude Opus 5.5 01dbccee18 Merge main into feat/tool-213-7-live-retouch
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 22:42:01 +02:00
Higgs32584andClaude Opus 5.5 7b32097e2a Intel Iris Xe on DX12: no more red blocks in brush previews and tool icons (#6790)
wgpu-hal 30 creates Iris Xe textures as committed resources (its
gfx-rs/wgpu#3552 workaround) with D3D12_HEAP_FLAG_CREATE_NOT_ZEROED, and
egui-wgpu fills each new texture with a single copy. On this driver the
copy leaves 4x4 blocks of all-zero texels showing stale memory, so the
empty corners of Brush Preset picker strokes and tool icons show freed
textures' pixels (often red).

ui-egui's new texel_guard plugin rewrites fully transparent texels in
each frame's texture uploads as premultiplied (0, 0, 0, 1) before eframe
renders them (under one 8-bit level of difference). The desktop app
installs it only for DX12 on "Iris(R) Xe", the same adapter test wgpu
uses; PHOTOCRAFT_TEXEL_GUARD=1/0 forces it on or off.

The gpu example zero_block_probe reproduces the driver bug without the
UI: 630/1500 egui-style uploads read back wrong, 0/1500 with the guard.
Driving the release app (tool cycling, picker rescaled): 6/40
screenshots with red blocks before, 0/120 after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:40:42 -04:00
Finn Newick 82aa300b51 Merge remote-tracking branch 'origin/main' into fix/bundle-save-lock 2026-10-16 21:34:43 +01:00
David MannandClaude Opus 5.5 824cbdb022 Merge main into docs/scorecard-stale-rows-2
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 22:19:08 +02:00
David MannandClaude Opus 5.5 1b0e69d2f6 Merge main into feat/tool-214-12-shape-feather
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 22:07:55 +02:00
David MannandClaude Opus 5.5 83afd80a87 Merge main into feat/ui-217-4-save-in-background
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 22:01:22 +02:00
David MannandClaude Opus 5.5 1336022624 Merge main into perf/p25-blur-cancel
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 21:58:23 +02:00
David MannandClaude Opus 5.5 78ae69a456 Merge main into feat/file-215-2-noparam
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 21:55:46 +02:00
David MannandClaude Opus 5.5 7977bed5c4 Merge main into feat/ui-217-4-animated-zoom
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 21:55:27 +02:00
David MannandClaude Opus 5.5 362f7168ee Merge main into feat/file-215-2-blur
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 21:53:52 +02:00
David MannandClaude Opus 5.5 e361737258 Merge main into feat/file-215-2-stylize-pixelate
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 21:53:31 +02:00
David MannandClaude Opus 5.5 5990376d1c Merge main into feat/file-215-2-other
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 21:50:49 +02:00
David MannandClaude Opus 5.5 1af75eef72 Merge main into feat/file-215-2-sharpen-noise
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 21:50:26 +02:00
David MannandClaude Opus 5.5 6199c1e04d Merge main into feat/file-215-2-wind-extrude-tiles
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 21:50:14 +02:00
David MannandClaude Opus 5.5 c751ef0ce8 Merge main into feat/file-215-2-mezzotint-halftone
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 21:47:48 +02:00
David MannandClaude Opus 5.5 de6b798aa2 Merge main into feat/ui-217-4-columns-unit
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 21:29:16 +02:00
Khawar Zamman WaniandClaude Opus 5.5 dcc5387388 Merge main into feat/6000-color-panel-modes
Resolve conflicts: keep both sides' new i18n strings, combine the
ui-parity change note, regenerate docs/scorecard.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 23:32:29 +05:30
augrclkandGPT-6 388b7f2a05 Merge upstream main into fix/brush-transfer-mixer-controls
Retain both progress histories and integrate the existing Brush Settings changes with upstream. Preserve the response-curve editor, options-label scrubbing and independent preset regression tests where they overlap.

Co-authored-by: GPT-6 <noreply@openai.com>
2026-10-16 21:01:03 +03:00
vangel76andClaude Opus 5.5 e674e1bc58 Merge upstream/main into fix/3290-filter-mask-paint
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 19:20:07 +02:00
tareqziad1998andClaude Opus 5.5 8dcc64bd2f Type: paragraph direction buttons in the Paragraph panel and options bar (TYPE-218-2, #218)
The engine has had TextDirection (Auto / LTR / RTL) and type.setStyle's "direction" key, but
nothing in the UI set it. Now:

- Window > Paragraph and the Properties Paragraph section have a row of three buttons under the
  alignment row: Automatic, Left-to-right and Right-to-left paragraph direction. They set the
  selected layers' direction (or the selected text's paragraphs while typing) in one undo step,
  and show the current one.
- The Type options bar has the same three buttons after its alignment buttons. Like alignment,
  they also set the direction new type starts with (new tool option `type_direction`, "auto" by
  default, reset with the tool's other options).
- The glyph is drawn (a pilcrow over an arrow), so no new icon asset.
- The three tooltips are translated in all 20 catalogs (every_tl_literal_is_translated).

Tests: paragraph_direction_buttons_set_and_show_the_direction and
options_bar_direction_sets_selected_layers_and_new_type.

TYPE-218-2 goes from missing to partial: the visual RTL caret (arrow keys moving on screen
rather than in logical order) is still to do. scorecard/type.toml, docs/scorecard.md and
docs/gaps.md (G8) are updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpQQNxTPBzSLvgAhX27Vtv
2026-10-16 15:58:53 +00:00