Commit Graph
11425 Commits
Author SHA1 Message Date
aiongg ed1b9cff3f Merge pull request #8783 from wanikhawar/select-mask-edits
Select and Mask: tool edits as select.refineEdge params (engine, part 1 of 2)
2026-10-23 09:49:52 -04:00
Dylan M. TaylorandCodebuff 96042b8e7a fix(text): bound untrusted font and PSD text processing (#8768)
* fix(text): bound font paths and imported text processing

Reject encoded path tricks and cap resource-heavy font and PSD text processing to keep untrusted inputs bounded.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>

* fix(text): reject percent-encoded DEL in served paths; satisfy clippy chunks_exact lint

---------

Co-authored-by: Codebuff <noreply@codebuff.com>
2026-10-23 09:40:04 -04:00
Batuhan Gözegü 1df36facbd i18n(tr): fix mistranslations, inconsistencies and untranslated rows
- Color Decontaminate: "Renkli" (colourful) -> "Renkleri Arındır"
- Warp split commands and "Cancel warp": "Çözgü" (textile warp) -> "Çarpıtma"
- Constraint hint: "Shift" was translated as "kaydırma"; keep the key name
- Highlights (tonal range) -> "Parlak Tonlar", as in the other rows
- Luminance -> "Lüminans" (was "parlaklık", which is Brightness)
- Indexed -> "İndekslenmiş", Trilinear -> "Üç Doğrusal"
- Levels In/Out Black/White: distinct "Giriş/Çıkış Siyahı/Beyazı"
- Layer Knocks Out Drop Shadow now says "Alt Gölge" like Drop Shadow
- Contact Sheet II -> "Kontak Sayfası II"
- Fix word order of the clone-source hints, "After (X)", "On Black/White"
- Translate "Preview size" and "Print preview image"
- Keep theme names Solarized and Breeze; Pro Light -> "Pro Açık"
- Add contributor entry for the author
2026-10-23 16:35:27 +03:00
Dylan M. TaylorandCodebuff 56d7009c78 fix(paint): validate gray tile dimensions safely (#8772)
* fix(paint): check tile dimensions before allocation math

Reject overflowing tile dimensions during deserialization and treat invalid in-memory tiles as empty safe previews and mipmaps.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>

* test(tile): assert the address-space overflow error on 32-bit targets

---------

Co-authored-by: Codebuff <noreply@codebuff.com>
2026-10-23 09:27:54 -04:00
Dylan M. TaylorandCodebuff ecff046ea1 fix(algo): avoid repeated copies of duplicate EXIF text (#8771)
* fix(algo): avoid copying duplicate EXIF text payloads

Keep the first valid text value for each EXIF tag, preventing duplicate entries from repeatedly decoding and copying large attacker-controlled strings.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>

* test(exif): count text decodes so the duplicate-tag test observes skipped payloads

---------

Co-authored-by: Codebuff <noreply@codebuff.com>
2026-10-23 09:27:48 -04:00
Jason DandClaude Opus 5.5 ee261f4690 docs: regenerate the scorecard on current main
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 09:12:11 -04:00
Jason DandClaude Opus 5.5 e4acb3c5ca Merge PR 3 (now on current main) into PR 4
Brings split/tiff-channels-io at f53aa0b9 (PR 1 and PR 2 on main
1695f323). Resolutions:
- PsdExportOptions: main's read_linked_files kept; PR 3's
  photoshop_spot_polarity switch stays removed, as this branch does.
- crates/io/src/lib.rs: main's import_psd(), calling
  psd_to_document_decoded without the removed PsdImportOptions.
- docs: PR 3's and main's text, with this branch's PSD statements
  re-applied (dated 2026-10-23). docs/scorecard.md is regenerated next.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 09:10:08 -04:00
Jason DandClaude Opus 5.5 f53aa0b9a2 docs: regenerate the scorecard on current main
FILE-215-7 done and FILE-215-17 partial, as before the merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 09:05:25 -04:00
Matthias Schlich 048e8a833b feat(filters): Lens Flare 105 mm and Movie Prime fitted over several positions
The 105 mm Prime's and Movie Prime's tables came from one position per brightness, so parts that
lay outside that image (far-out profile values, reflections off the edge) were guesses and showed
as wrong arcs elsewhere. Their profiles are now solved jointly over three positions per
brightness, plus three more images (another position, square and portrait) at 100 %.

Movie Prime's streaks follow Photoshop's placement rule: each passes through a fixed point on the
axis (t = 0, 0.12, 1.80, 2.00) at a fixed angle in the image (0, 45.2, 45.2, 0 degrees).

105 mm Prime is now at the ceiling Photoshop's random grain allows at every position (e.g. 0.970
to 0.977 at 100 %, portrait 0.82 -> 0.970); Movie Prime scores 0.975-0.997.
2026-10-23 15:05:14 +02:00
Jason DandClaude Opus 5.5 a23f7e4fde Merge PR 2 (MTrn marker, now on current main) into PR 3
Brings split/psd-mtrn-marker at 4e8605ae. The only conflict was
docs/file-format-parity.md, where this branch's status line and rows
already carry the MTrn entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 08:52:38 -04:00
Jason DandClaude Opus 5.5 e5be3083a7 Merge PR 1 (codecs, now on current main) into PR 3
Brings split/tiff-extra-samples-codecs at e6fca054, which merged main
1695f323. Conflicts:
- crates/io/src/lib.rs: main moved PSD import into import_psd(); it now
  passes PsdImportOptions::default().
- PsdExportOptions (psd_export.rs, tiff_layers.rs): main's new
  read_linked_files next to this branch's photoshop_spot_polarity.
- docs: main's newer status lines and rows, with this branch's TIFF
  statements re-applied (dated 2026-10-23). docs/scorecard.md is main's
  and is regenerated after PR 2 is merged too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 08:48:35 -04:00
Jason DandClaude Opus 5.5 e6fca0548f Merge current main into split/tiff-extra-samples-codecs
Conflicts: crates/codecs/src/image.rs (main's new `cicp` field next to
this branch's converted extra-sample planes in `meta`) and
contributors/people.toml (main's new entries kept, jasallen's added after
them). The codecs integration tests moved into tests/it/ on main; this
branch's test changes followed them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 08:43:11 -04:00
Jason DandClaude Opus 5.5 4e8605aea9 Merge current main into split/psd-mtrn-marker
Resolves docs/file-format-parity.md: main's newer status line and
revision rows, with this branch's MTrn entry on top (dated 2026-10-23).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 08:40:38 -04:00
Dylan M. TaylorandCodebuff 1695f323e6 fix(psd): retain pattern budget charges after parse failures (#8767)
Keep allocation charges monotonic when malformed pattern blocks fail, so later sections cannot reuse budget already consumed.

🤖 Generated with Codebuff

Co-authored-by: Codebuff <noreply@codebuff.com>
2026-10-23 08:38:15 -04:00
midasdf 1779e69c7d Merge remote-tracking branch 'origin/main' into jp/print-paper-sizes 2026-10-23 21:01:23 +09:00
SimoneRecchia 53d38f6987 fix(ui): a locked shape refuses the Color Picker before the next shape's colour changes
From the options bar with a locked shape selected, OK in the Fill/Stroke
Color Picker set the next shape's colour and only then failed on the
locked layer. confirm now checks the layer's locks first and returns
"shape layer is locked" with nothing changed.
2026-10-23 11:20:47 +00:00
Khawar Zamman Wani 4cfc219dfb fix(paint): smooth hard-round preset strokes (#8842) 2026-10-23 16:50:08 +05:30
Matthias Schlich a197e018c7 feat(filters): Lens Flare brightness and size as in Photoshop
Brightness didn't scale the light: in Photoshop it changes the shape of the flare (the core grows,
the glows widen, at 300 % most lenses wash out to white). Each lens is now measured at 10, 50,
75, 100, 125, 150, 200 and 300 % and the flare blends the two levels around the requested
brightness.

The flare was sized by the image diagonal; Photoshop sizes it by the width alone (checked with
square and portrait documents), now 1/800 of the width per flare unit.

SSIM against Photoshop at every measured brightness: 50-300 mm Zoom 0.993-1.000, 35 mm Prime
0.9925-1.000, both also >= 0.992 at other positions, in square and portrait documents and over
grey. 105 mm Prime and Movie Prime still fall short (see the PR).
2026-10-23 12:41:28 +02:00
D-monizedandClaude Opus 5.5 67c64e7a51 docs: leave the scorecard count to the integration batch
This branch adds one preference; the 'settings that do nothing' total is recounted when the batch is integrated, so two open PRs don't keep conflicting on the same two lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 04:25:01 -06:00
Marco Arnulfo ed868a65d4 Export As: fit a remembered size to the layer, and keep a 1 px derived side
Layer > Export As now fits the remembered size against the layer's trimmed
size directly, instead of fitting the document first and refitting the layer
from the percent the document fell back to. A linked side whose other side
rounds below one pixel keeps it at 1 px, as the Scale field already does.
2026-10-23 11:59:54 +02:00
andeecollard b7d3b7ca51 macOS menus: honor saved Hide, Minimize and alternate Settings bindings 2026-10-23 10:58:07 +01:00
xwizeandClaude Opus 5.5 ba22b57e83 Contributors: drop the people.toml entry from this PR
It isn't part of the Indexed Color fix; the credit can come separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:50:41 +01:00
xwizeandClaude Opus 5.5 68ca48ddeb Indexed Color: Pencil Auto Erase compares against the painted colour
Review follow-up. In an Indexed document an off-table foreground paints as
its nearest table entry. Auto Erase still compared the stroke's start pixel
with the raw foreground, so a second stroke that started on what the first
one painted never switched to the background colour. Both the commit and
the live preview now compare against the foreground as the table paints it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:46:57 +01:00
Khawar Zamman WaniandClaude Opus 5.5 505503b93a fix(ui-egui): keep the Pen draft when its commit is refused
With a Path Operation other than New Layer and a locked shape layer
selected, the Pen's commit was refused by the engine after the draft had
been taken, so the drawn path was lost with no History step to undo.
pen_commit now restores the draft on any failed commit and reports it;
the Curvature Pen, Make Selection, the canvas menu actions and ⌘-click
stop instead of carrying on with the wrong path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FszacAJDjznVimaxQktoJT
2026-10-23 15:14:56 +05:30
xwizeandClaude Opus 5.5 d73604860e Indexed Color: remap only the pixels a stroke changed, a tile at a time
Review follow-up. The palette step quantised the whole stroke damage
rectangle as one dense buffer. A long diagonal stroke on a large canvas has
a rectangle near the size of the document, so this allocated about 28 bytes
per pixel of it. It also remapped pixels inside that rectangle the brush
never touched, which can already be off the table (Paint Bucket doesn't
snap yet).

keep_in_color_table now walks the rectangle tile by tile and maps only the
pixels that differ from the surface before the stroke (a cheap clone: tiles
are shared until written). The live preview compares against its own
pre-stroke surface the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:33:48 +01:00
xwizeandClaude Opus 5.5 33e8eedde8 Contributors: credit xwize as James Jones
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:18:39 +01:00
xwizeandClaude Opus 5.5 e22984536c Indexed Color: keep Brush strokes inside the colour table
An Indexed Color document keeps its pixels expanded to RGB with the palette
as side data, and the Brush rendered straight onto that surface. A red
stroke on a black/white document therefore left opaque red pixels, and soft
edges or partial opacity left blends, all outside the colour table, while the
document still reported Indexed mode. Photoshop (and GIMP, which documents
it) paint the nearest table colour instead.

The stroke commit now maps the damaged rectangle to the nearest table entry
with the same no-dither quantiser the Indexed Color conversion uses. That
keeps the table's transparent entry binary as well. The live preview
applies the same step, so the canvas shows the pixels the commit keeps.
This covers paint.stroke and paint.pencil, including erasing. Masks and
channels are gray targets and are left alone.

Fixes #8669

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:18:30 +01:00
Khawar Zamman WaniandClaude Opus 5.5 f58e2f4275 fix(algo,engine): refuse a Select and Mask refine too large to allocate
refine_mask_with builds its result densely over the selection's bounds
(grown by the spread, plus Refine Edge Brush additions). After a thin
edit across a huge canvas, or with a whole-canvas selection there, that
is billions of pixels. matting::refine_area names that area and
select.refineEdge refuses one over MAX_REFINE_AREA (2^30 px) with an
error before allocating, leaving the selection unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FszacAJDjznVimaxQktoJT
2026-10-23 14:41:20 +05:30
Khawar Zamman WaniandClaude Opus 5.5 56bbe6b80b fix(algo,engine): paint Select and Mask Brush, Lasso and Refine Edge Brush tile by tile
The Brush edit, the Lasso edit and EdgeBrush::new allocated a dense buffer
over their bounding box, which the swept-area cap does not bound: a 1 px
diagonal across a 100,000 px canvas sweeps ~141k px but asked for ~40 GB.

- matting::brush_surface (replaces brush_region) and EdgeBrush paint only
  the tiles a stroke touches (painted_tiles), capped at MAX_PAINTED_TILES.
- selection::polygon_surface rasterises only the tiles the Lasso's edges
  cross, byte-identical to selection::polygon; interior tiles share one.
- selection::combine_sparse adds/subtracts visiting only the new shape's
  tiles, keeping the rest of the selection shared.
- select.refineEdge refuses edits and refineStrokes that would cross too
  many tiles before painting anything, leaving the selection unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FszacAJDjznVimaxQktoJT
2026-10-23 14:22:33 +05:30
aiongg 18f4b5348c Tests: spread three format-by-geometry matrices over the days, and build one precheck state per case
The tilt-shift reference tests and tiled_clear_and_fill_match_one_pass_over_the_area cross pixel
formats or channel counts with independent geometry and fill settings. Each run takes a quarter of
the combinations through Sweep, a different quarter each UTC day.

precheck_agrees_with_execute built all five document states for every call and kept one; it now
builds only the state the call needs.
2026-10-23 08:30:48 +00:00
D-monizedandClaude Opus 5.5 0056b44a6f Merge origin/main into feature/font-recent-favorites
main now has its own Recent Fonts (#3559), so this branch drops its separate
recent list (prefs `recentFontList`, `type.font.noteRecent`, `type.font.clearRecent`,
the five-font cap) and its font menu uses main's: the list is
`PhotocraftApp::note_recent_font`'s, the rows and arrow keys main's `font_menu_rows`,
and every applied family is recorded, as main does. Favourites, the class and
similar/variable filters, the style expander, format badges and the live preview
stay. Faux Bold keeps the one-pass thickened outline on main's fallible coverage
buffers (#6001), budgeted as a plain pass. Both sides' strings and icon credits are kept;
the scorecard is regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 02:28:05 -06:00
Gert Pellin fa8c55da56 CLI: document run and batch, and the test helper 2026-10-23 10:06:32 +02:00
Gert Pellin 7c180529d6 Layers: a new fill or adjustment layer drops the selection it took as mask (#8801)
A new fill or adjustment layer made while something is selected takes the
selection as its layer mask (#1250). In Photoshop the marching ants are then
gone, as after Reveal Selection, which drops the selection since #5251.
PhotoCraft kept it, so the next pixel edit on another layer (Duplicate,
Desaturate, Levels…) only touched the area inside the old selection.

mask_new_layer now clears the selection when it became the layer mask, in
the same history step: one undo removes the layer and brings the selection
back. A path used as vector mask leaves the selection alone, and so does the
Gradient tool's fill layer.

Tests: new_adjustment_and_fill_layers_are_masked_by_the_selection asserts the
selection is gone and comes back on undo, and the new
an_edit_after_a_new_fill_layer_on_a_selection_reaches_the_whole_layer covers
the duplicate-and-desaturate case (both fail on main). Tests that deselected
right after a new fill layer no longer need to; tests that need a selection
after one select again.
2026-10-23 10:05:10 +02:00
PerchAnton 8b566e3334 fix(automation): retain parent components in an absolute configured root 2026-10-23 10:48:07 +03:00
Gert Pellin e923de0ff8 CLI: run and batch skip Deselect with nothing selected, as playback does (#8802)
Action playback treats Deselect with nothing selected as a silent no-op
since #6744, as Photoshop does. photocraft-cli runs its --cmd list and
batch steps one by one through command_run, so a Deselect after Reveal
Selection (which drops the selection since #5251) stopped the whole run
with "no selection" and wrote no output.

run and batch now use the same check as playback (actions_cmds::noop_step,
now public). run still prints a result line for the skipped step. A single
Deselect outside a script stays disabled, as the #6744 test wants.

Tests: deselect_noop_tests::run_skips_deselect_with_nothing_selected and
batch_skips_deselect_with_nothing_selected (both fail on main).
2026-10-23 09:41:23 +02:00
aiongg b87cfb3c6a Tests: spread the two longest sweeps over the days
swept_blocks_match_the_pixel_search skips the cases where the colour mode reaches extrude only
through a channel count and ink setting an earlier mode already covered. It and
damaged_layer_data_opens_flattened run a quarter of their cases per run, a different quarter each
UTC day (photocraft-testkit's Sweep). PHOTOCRAFT_FULL_SWEEP=1 runs every case, and
PHOTOCRAFT_SWEEP_PART=<n> replays the part a failing run printed.
2026-10-23 07:20:54 +00:00
PerchAnton ebbfa89566 Merge main into automation root paths; retain Windows and JPEG updates 2026-10-23 10:18:51 +03:00
Khawar Zamman WaniandClaude Opus 5.5 2d894eab2b fix(engine): tile-wise Invert edit; a run of Inverts costs one
Review of #8783:

- The Invert edit no longer builds a canvas-sized buffer: the canvas
  takes the inverse of the selection's untouched value (one shared tile
  for every fully covered tile, as fill_rect stores it), then only the
  tiles the selection holds are inverted. Byte-for-byte equal to the
  dense inversion; a 100k x 100k canvas inverts in well under a second.
- A run of Inverts is applied as one or none (pairs cancel exactly), so
  4096 of them cost at most one pass between other edits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 11:42:26 +05:30
aiongg 175c9c1e75 xtask: test with nextest, doctests separately, one wasm check call
cargo xtask test and the ci test step run cargo nextest over libs, bins and tests when nextest is
installed (cargo test otherwise, with a notice), then cargo test --doc. The wasm check is one
cargo check with --keep-going over the wasm-safe crates, plus one call per optional web feature.
Clippy runs with --keep-going.
2026-10-23 06:00:38 +00:00
aiongg 6ed69874fd Profiles: no debug info for dependencies in dev and test builds
Workspace crates keep line tables, so panics in PhotoCraft code still show file and line.
2026-10-23 06:00:19 +00:00
Matthias Schlich 2adff9e7d9 fix(filters): clippy findings in the new Lens Flare
A leftover doc comment from the removed ghost struct, an unneeded max(0) on an unsigned width,
and index loops over the colour channels written as zips.
2026-10-23 07:52:11 +02:00
haranishi 11967f554e Merge upstream main into fix/brush-shift-right-blend-4929 2026-10-23 14:51:45 +09:00
haranishi 9c47ee6dd5 fix(ui): consume the right-button release after dismissing brush modes 2026-10-23 14:51:45 +09:00
Patrik LermonandClaude Opus 5.5 8407e04b95 i18n(sv): translate 153 new strings
Brings the Swedish catalog up to date with upstream main (ff4738810).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 07:51:28 +02:00
Khawar Zamman WaniandClaude Opus 5.5 ca13e355c9 fix(algo,engine): bound brush stroke work and total brush edit area
Review of #8783:

- matting::brush `segments` no longer collects its pieces: they are made
  as they are painted, and each segment is first cut to the painted area
  grown by the brush. A 1 px stroke zigzagging across 2 million px
  (within MAX_SWEPT_AREA) split into ~134 million pieces collected up
  front (~2 GB) in brush_region and EdgeBrush::new; now ~5000 pieces.
- select.refineEdge `edits`: the Brush edits' swept area in all is
  bounded by MAX_SWEPT_AREA, as refineStrokes' is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 11:14:50 +05:30
Patrik Lermon c9b6df0f6d Merge upstream/main into swedish-ui 2026-10-23 07:35:36 +02:00
Finn NewickandClaude Opus 5.5 3ef632d313 fix(align): an uncached fill that shows everywhere measures as the canvas
Without a cached render, an inverted or sub-100 % density fill measured
as empty and dropped out of Align and Distribute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 06:30:34 +01:00
Finn NewickandClaude Opus 5.5 ad91e9f387 fix(align): feather a measured shape over its reach, gradients in the canvas
CompiledShape::new used one rectangle as both the gradient frame and the
area a feather is computed over, so measuring in the document's frame cut
the feather off at the canvas. CompiledShape::with_frames takes the two
separately; Align measures with the feather over the shape's reach and
gradients in the canvas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 06:17:56 +01:00
Finn NewickandClaude Opus 5.5 9a570c5ed5 fix(blur): one kernel width for every Gaussian radius below 1
A width chosen per radius added taps at 1/3 and 2/3, where the blur dipped.
The variance-matched kernels now all use a half-width of 3, the width
gaussian_kernel has at radius 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 06:15:38 +01:00
aiongg a87b56b32a Merge upstream/main into stored-path-resolve 2026-10-23 05:08:54 +00:00