* 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>
- 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
* 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>
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>
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.
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>
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>
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>
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>
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.
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).
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>
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.
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>
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
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>
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>
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
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
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.
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>
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.
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).
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.
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>
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.
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.
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>
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>
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>
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>