Commit Graph
11425 Commits
Author SHA1 Message Date
Hamza f593160537 Crop: a press that hasn't moved is not a change, Show Cropped Area off keeps its fill, and the dashed outline is cut to the view 2026-11-03 16:25:13 +05:00
Claude a30e90a011 #10682: the Batch tests check the pixels the action changed and each failure line word for word
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GbuSKAS2k5248LGFEapMUR
2026-11-03 11:22:57 +00:00
Claude 355cade6a3 #10726: a smooth corner endpoint's bent handle follows the way its segment arrives; carried joins tested further
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GbuSKAS2k5248LGFEapMUR
2026-11-03 11:22:57 +00:00
FredApps 362baf5faa Merge remote-tracking branch 'upstream/main' into pr-5332 2026-11-03 12:21:30 +01:00
FredApps 0f4e462570 Render zoomed-out viewport pages through the reduced composite
Pages reduced by k > 1 whose source starts on a multiple of k now use the
band/tile reduced render (one-colour tile skipping, parallel tiles) on a
factor-aligned cell grid instead of compositing every pixel at full size and
averaging. Unaligned sources keep the averaging path, which tests use as the
reference (U8/U16/F32, k = 2, 4, 16, max difference < 1e-4). The reduced
render now checks the page's interrupt between bands.
2026-11-03 12:21:27 +01:00
FredApps 0a528eea19 automation: remove the temp file on every exit but a rename, a panicking writer included
A drop guard armed only once this call created the temp file replaces the error-path
remove_file, so a writer panic no longer leaves a temp file and a create_new collision
never removes a file this call did not make.
2026-11-03 12:16:23 +01:00
FredApps be3b2918c3 raster: checksum stage-file appends and fail a read pass over changed bytes
Like the tile scratch file, each append records a CRC-32; a save copying it (whole or
in consecutive parts) fails on the last part if the scratch disk returned different
bytes, so the document is never replaced with them.
2026-11-03 12:16:23 +01:00
Dylan M. Taylor 9779daf357 security(affinity): charge allocation records, empty subpaths, paint lists, tile indexes and shape lookups (#10966)
* security(affinity): charge allocation records, empty subpaths, paint lists, tile indexes and shape lookups

Several readers still did work per occurrence of a shared object that no
document-wide budget counted:

- Archive::open walked every allocation table's records, and overlapping tables
  could reparse one long run thousands of times. Records are now charged against
  MAX_TABLE_RECORDS before each table is walked.
- curves() charged a subpath's records but not the subpath, so a shared curve
  full of empty subpaths was walked for free. Each subpath now costs one record.
- Colours and gradient positions decoded their whole float record (up to 64 KiB)
  to read two to five components; only those are decoded now.
- Paint selection collected whole BFFl/LIFl/LILn lists without charging their
  slots; the lists are charged and walked once without collecting.
- Dash patterns were copied per occurrence with no length limit; they are capped
  at 64 entries and charged against the document budget.
- The raster tile index skipped null Idx slots uncharged; every slot walked is
  charged now.
- shapes::last rescanned all fields per lookup and CTyp/ShCR were copied whole;
  the field index records last occurrences too, and only four corners are read.

* test(affinity): cover the allocation record budget across chained tables

* test(affinity): directory records count against the allocation record budget
2026-11-03 06:03:23 -05:00
Dylan M. Taylor 4a65ae3fb0 codecs: refuse EXR preview attributes larger than their value (#10982)
The exr crate sizes a preview attribute's pixel buffer from its
declared dimensions (up to 4 MiB at once, zero-filled) before it finds
the attribute too short, and in the non-pedantic mode every reader here
uses, it then skips the attribute and continues. A header with
thousands of tiny malformed previews therefore cost thousands of 4 MiB
allocations before any size check ran.

check_previews walks the raw headers and refuses a preview whose
declared width x height x 4 exceeds its value size. It runs before
every header read: read_meta, read_layer, the Cryptomatte listing and
decode_deep_exr.
2026-11-03 06:03:16 -05:00
Dylan M. Taylor 76f67c0f10 Portable mode: create the write probe exclusively, never through an existing entry (#10963)
The portable data folder's writability check wrote a fixed, PID-named file with
std::fs::write, which follows an existing symlink and truncates its target.
Create the probe with create_new, try another name on a collision, and remove
only a probe this call created.
2026-11-03 06:03:09 -05:00
Hamza 08b6431488 Crop: an untouched frame shows only a dashed outline; the shield and overlay start with the first change 2026-11-03 15:50:52 +05:00
yoriswind c135363fe6 Preserve action header colours through ATN load and save 2026-11-03 02:49:08 -08:00
ljkx a112beda7e CLI --metadata test: the export keeps the input's own ICC profile
Review nitpick (#9466): the test only checked that the default export had some ICC profile and that `none` matched it, so a regression writing sRGB instead of the input's Display P3 would still pass. It now compares the default export's profile with the input's bytes.
2026-11-03 11:45:00 +01:00
ljkx a99e8696fc CLI --metadata: qualify the docs per format, test text and ICC (#9466)
Review follow-up on #9975. The help text and the CLI book page said the
XMP and free-form text are kept in every flat export and the ICC profile,
EXIF and resolution "either way". Not every format holds them: JPEG and
WebP have no place for free-form text, TIFF writes only its named text
tags, and an Indexed Color document's palette PNG carries no XMP, text,
ICC or EXIF at all, only its resolution. The texts (and the parity-doc
revision row) now say the XMP and text are kept where the format holds
them and that the option leaves everything else as it is without it.

The test fixture gains a free-form text entry and a Display P3 profile
(from photocraft-cms, now a dev-dependency; no profile file committed),
so it checks the text is gone with `none` and kept by a default PNG, and
that the default export keeps a real ICC profile that `none` matches,
instead of comparing None with None.
2026-11-03 11:44:55 +01:00
ljkx b5770e4283 CLI: --metadata none|all for convert, run --out and batch (#9466)
Since #733 a flat export from the CLI keeps the document's whole XMP
packet and free-form text, as Save As does; only Export As starts at
Metadata: None. Batch exports of Photoshop masters therefore carry the
full DocumentAncestors list (and the text of every type layer), which
can be many times larger than the image, with no way to leave it out.

`--metadata` is a new export option shared by `convert`, `run --out`
and `batch`. `none` sets ExportOptions::xmp to XmpEmbed::None, the same
path Export As's Metadata: None and Quick Export use, so the XMP packet
and free-form text are dropped while the ICC profile, EXIF and
resolution are written as before; PSD, PSB and .pcraft keep the XMP
either way. `all` is the default, so existing scripts write the same
files. Any other value is a usage error (exit 2) naming the flag,
before anything is read or written.

Tested through the binary for PNG, WebP, JPEG and TIFF from all three
subcommands (packet present by default and with `all`, absent with
`none`; pixels, ICC and resolution unchanged), layered saves, and bad
values. Documented in the CLI book page and file-format parity doc.
2026-11-03 11:44:39 +01:00
Raghav Krishna 2b0af5618b Test the canvas Crop menu glyphs
Review follow-up: open the menu on a started crop and assert it adds a glyph
texture per overlay, so the canvas menu's icon wiring cannot regress silently.
2026-11-03 16:11:55 +05:30
Raghav Krishna 1d86b32bab Crop: give each overlay its own glyph in the menus and on the options button
Six original icons in the house style, one per crop overlay, drawn in the
crop-mark frame around the guide they name. They sit between the check mark
and the label in the options-bar overlay menu and in the canvas Crop menu, and
the options-bar button paints the overlay in use.

Tests: crates/ui-egui/tests/it/crop_overlay_icons.rs (#10889).
2026-11-03 15:52:40 +05:30
Hamza a0ec548cd7 Crop: the overlay shows Always by default, and Fill resets when another open document becomes active 2026-11-03 15:19:39 +05:00
FredApps 66e9325379 Merge remote-tracking branch 'upstream/main' into pr-5332 2026-11-03 11:16:12 +01:00
FredApps 7cffeef725 Merge remote-tracking branch 'upstream/main' into pr-5333 2026-11-03 11:16:05 +01:00
FredApps 6efb0682b2 Re-render only the texels a small edit reaches into the viewport page held 2026-11-03 11:16:05 +01:00
FredApps 503aa60f5a Merge pull request #10897 from wanikhawar/fix/adaptive-psd-memory
Size PSD import memory limits from available RAM
2026-11-03 11:14:59 +01:00
Raghav Krishna a354b64112 Clear the Selection preset state when a ratio re-fits the frame
Review follow-up: a ratio picked on the untouched frame changes its bounds, so
the temporary "Selection" entry must not come back when the ratio is cleared.
The dropdown test now also checks that the entry sits above the Ratio presets
and reads as checked.
2026-11-03 15:33:19 +05:30
Hamza fcf57cf2b4 Layers filter: fill layers match no Kind button, and the Mode list has no Pass Through 2026-11-03 14:55:32 +05:00
FredApps d1f112c38e automation: stream workspace saves instead of buffering the encoded file
AuthorizedWorkspace::write_stream keeps write()'s refusals and atomic replace but
lets the encoder write (and seek back) straight into the temp file, so an
automation PSB save no longer builds the whole file in a Vec.
2026-11-03 10:49:38 +01:00
FredApps dbcee2ba47 io: stage encoded PSD/PSB channels on the scratch disk for large saves
Each colour channel and the merged image is parked in a scratch stage file as
soon as it is encoded (documents of 1 GiB+ raw pixels, chunks of 64 KiB+), so a
save no longer holds every encoded plane in memory before #8115's checked write.
The written file is byte-identical; when staging is unavailable the data stays
in memory.
2026-11-03 10:49:38 +01:00
FredApps 4b27da939f raster: anonymous append-only stage file on the scratch disk
Shares ScratchFile's private open (0600, unlinked at once, delete-on-close on
Windows) so encoded save data can be parked off the heap and read back by offset.
2026-11-03 10:49:38 +01:00
FredApps 0fd110e150 Free the texture set a document leaves for viewport pages; cargo fmt
A document that goes over the canvas budget kept its texture set (and the compositor's
pages for it) resident while drawn from viewport pages, holding the memory the pages are
budgeted against. texture_key is needed outside tests now; fetch_update is deprecated.
2026-11-03 10:41:04 +01:00
FredApps 2bad559628 psd: copy source-backed channel and merged data through in short reads
A channel or merged image still in its source (an imported file's, or one
spilled to scratch) is copied to the output in 8 MiB pieces instead of being
read whole into memory first.
2026-11-03 10:33:52 +01:00
FredApps 5f70428dfc Merge storytold/main (d0bff086d) into PR #10897 branch
Resolve conflicts with #5331 (EXR streaming): the block-by-block EXR import now
reads from the same identity-verified handle as the rest of the open path, and
docs/scratch-disks.md keeps both the EXR streaming pointer and the RAM/scratch
admission notes.
2026-11-03 10:33:10 +01:00
FredApps d077cd14fc Merge remote-tracking branch 'upstream/main' into pr-5333
# Conflicts:
#	crates/codecs/src/exr_stream.rs
#	crates/codecs/tests/it/exr_stream.rs
#	crates/io/src/exr_native.rs
#	crates/io/src/lib.rs
#	crates/io/tests/it/streaming_exr.rs
#	docs/roadmap.md
#	docs/scorecard.md
#	docs/scratch-disks.md
#	docs/streaming-io.md
#	scorecard/reliability.toml
2026-11-03 10:28:35 +01:00
FredApps 57443b6a30 Merge remote-tracking branch 'upstream/main' into pr-5332
# Conflicts:
#	crates/codecs/src/exr_stream.rs
#	crates/codecs/tests/it/exr_stream.rs
#	crates/io/src/exr_native.rs
#	crates/io/src/lib.rs
#	crates/io/tests/it/streaming_exr.rs
#	docs/roadmap.md
#	docs/scorecard.md
#	docs/scratch-disks.md
#	docs/streaming-io.md
#	scorecard/reliability.toml
2026-11-03 10:26:54 +01:00
FredApps 3ba7052474 Draw over-budget canvases from viewport pages on the GPU canvas
Redesign of the viewport streaming for #5332 on current main:
- Only documents whose display texture set doesn't fit the canvas budget
  (GpuCanvas::fits_canvas, from detected RAM/VRAM) use pages, so GPU Memory
  on Auto (gpu_memory_mb = 0) no longer streams every document.
- Documents that fit keep main's texture set path (LayerFit, DEFER_PX
  deferral, background redraw, admit_output); no pixel-count cutoff.
- Edits dirty only the pages their damage reaches; nothing scans layer tiles.
- Pages are held to half the per-document canvas budget; no change to the
  global wgpu resource budget or to gpu_budget's split between documents.
- Bounded workers (2) and uploads per frame, cancellation on pan/zoom/edit,
  CPU canvas fallback when a page fails or no page fits.
2026-11-03 10:26:23 +01:00
jayzed80andClaude Sonnet 5.5 4777b390c9 fix(algo): Filter Gallery draws pixels from the same clamped values as its reach
The tile halo was sized from the clamped effect values, but the pixel code still read the raw
stored ones, so a stored value past its range could have a kernel larger than its halo and show
seams where tiles meet. `run` and `Prepared::new` now clamp the stack once at the entry, so the
reach and the pixels use the same values. The new test renders every gallery filter with its
range values at three times the maximum and requires the same pixels as at the maximum; it fails
without the change (ColoredPencil first).

Addresses the CodeRabbit review on this PR.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 09:16:51 +00:00
Raghav Krishna 2d5d90178b Crop: name the Fill by Delete Cropped Pixels, and show Selection in the preset dropdown
The Fill dropdown's first entry now reads Background (default) with Delete
Cropped Pixels on, and Transparent (default) with it off, as the reference
application does; both keep crop_content_aware false, so only the label
changes. Its translations carry over from Background (Default).

The crop preset dropdown shows a checked Selection entry above Ratio while the
frame is the untouched default frame made from a selection's bounds. It is a
label: choosing it changes nothing, and editing the frame or picking a ratio
removes it.

Tests live in tools/crop_options_labels_tests.rs (#10872).
2026-11-03 14:40:36 +05:30
FredApps d0bff086d6 Merge pull request #5331 from vistaero/codex/psd-exr-streaming
Stream native PSD/PSB and EXR imports through bounded bands
2026-11-03 10:07:47 +01:00
FredApps d3e4bcd03d Merge main into codex/streamed-psb-save (rescope onto #8115)
Rescope: this merge takes main's tree as is. The stacked #5331 commit
(streaming PSD import reader, EXR, duplicate atomic/streaming save infra,
the try_reserve_operation export pre-check) and the #5332 GPU commit stay in
their own PRs; main's Services::save_file/SaveCtl and #8115's streamed PSD
writer replace this branch's save plumbing. The band-wise PSB writer is
re-added on top in the next commit.
2026-11-03 10:04:00 +01:00
FredApps 75e967b467 Merge pull request #8115 from VishnuByrraju/fix/save-memory-6607
Save: stop doubling the encoded file in memory (#6607)
2026-11-03 10:03:07 +01:00
FredApps 0ec30fcf7c Merge storytold/main into codex/gpu-viewport-streaming
Main moved the GPU canvas into canvas/gpu_canvas/* and gained its own
budget, LayerFit and background-redraw machinery. Conflicted files take
main's version; the viewport streaming is re-integrated on top of main's
budget in the following commit.
2026-11-03 09:59:21 +01:00
FredApps 3695186329 Consolidate RAM detection in raster::memory::system; scratch-aware PSD/TIFF admission
One RAM detector: the cgroup v1/v2, macOS reclaimable and Windows commit providers move from
photocraft-io into photocraft_raster::memory::system (L0), which the residency budget (#5330)
and photocraft_io::memory both read. Unreadable container limits still fail closed, swap is
never counted as RAM. sysinfo is unified on =0.40.1 (raster only).

While the scratch disk is spilling (on, not paused), import admission credits the tile pixels
of an estimate against spill::scratch_capacity() (free space above the reserve, within the
Scratch Size Limit); decode buffers, conversion copies and merged planes stay RAM-only. Spilling
off/paused and the web keep the RAM-only policy unchanged. PsdMemoryEstimate gains tile_bytes;
the flat TIFF streaming check credits its tile surface the same way; engine approveMemory's
fast pre-check uses the credited hard limit and the import re-checks exactly.
2026-11-03 09:48:22 +01:00
yoriswind 65b3830857 style(atn): format nested effects regression tests 2026-11-03 00:43:31 -08:00
yoriswind 040eaef002 test(actions): separate the history boundary oracle 2026-11-03 00:33:39 -08:00
DingusMcRinkyDinkyandClaude Opus 5.5 818d3a026e path.toShape: refuse a name that isn't text
A non-string `name` such as 42 was read as no name, so the command turned
the Work Path into a shape instead of reporting the mistake.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZbgszHyuEuWAzxaamteuU
2026-11-03 09:30:24 +01:00
yoriswind ad8d9f66a7 test(actions): extract deleted-row identity assertions 2026-11-03 00:27:37 -08:00
FredApps 05fc07b538 Merge main into fix/save-memory-6607
Resolve against main's save restructure (Services::save_file/SaveCtl, scratch-integrity checks,
ZipWriter::with_entries, exact encoded_len):
- PSD/PSB saves stream the file model through atomic_write_stream_progress; the length used for
  progress and reservations is main's exact encoded_len (the PR's size_bound under-counted lazy
  data); export_with/encode_with share checked_stages, so main's scratch checks (previews
  included) still refuse unreadable scratch.
- Drop ZipWriter::for_entries in favour of main's with_entries.
- TIFF: take_from_psd moves layer data out of the export's own model (never the document);
  body() reserves its exact length, failures are OutOfMemory (not LimitExceeded, which would
  trigger the PSB retry).
- Streaming writer: AlreadyExists from the writer is a failed save, not a name collision.
- Remove dead Vec put_widened_rle; channel_data_len is test-only.
2026-11-03 09:23:16 +01:00
FredApps 7e29a9999c Wire EXR band streaming into main's path open
- import_file_for_open_with decodes single-part flat scanline EXR block by block into
  tiles; headers the band decoder refuses fall back to the whole-file decoder, so files
  main opened still open. Band-time failures and cancellation publish no document.
- The RAM tile budget and scratch-disk checks live in exr_native (the PSD stream module
  they came from is dropped); over-budget opens fail with IoError::OutOfMemory.
- The band decoder picks colour channels with exr_color_channels, like the byte decoder.
- Tests move into the per-crate it binaries and use import_file; an engine open-job test
  covers the OpenSource::Path route. The ui-egui sync open test is dropped: main's
  synchronous open reads bytes, and the io test covers the oversized header.
- docs/streaming-io.md, roadmap, scratch-disks and REL-212-1 describe EXR only.
2026-11-03 09:23:15 +01:00
yoriswind c0bd466d5f fix(actions): retain explicit history deletions and user purge boundaries 2026-11-03 00:16:38 -08:00
yoriswind 9f8b880e2b fix(atn): retain nested layer-effects Make intent 2026-11-03 00:10:26 -08:00
yoriswind 6035bd7b17 test(atn): distinguish opaque metadata from typed effects references 2026-11-03 00:09:36 -08:00
yoriswind 5a768ded2c test(atn): retain nested layer-effects references during playback 2026-11-03 00:08:41 -08:00