278 Commits
Author SHA1 Message Date
David Mann ec236094ca Merge #16638 into the merge queue batch
fix(tools): a pattern from an Indexed image keeps painting (#13071)
2026-11-25 13:28:24 +01:00
f2ac09d2ec Fix-up for #11756: Align Edges as the reference application renders it
The PR snapped shapes with a per-edge heuristic (pixel_align.rs, dash-cap tie
rules, a PSD coordinate-frame field threaded through engine, format and caches),
defaulted the option to off, and renamed the existing Rectangle/Triangle
"Align Edges" checkbox to "Snap Bounding Box" next to a second checkbox.

The reference application fits the whole shape at render time: the bounds of
what it paints (fill, or the stroke's outer edge) get a whole-pixel left/top
(a half rounds up) and a whole width/height, and the path is translated and
scaled into that box. Fill and stroke take one transform; curves stay
antialiased; inner edges of several subpaths are not snapped.

- photocraft_vector::align_edges implements that rule; CompiledShape applies it,
  so caches, the compositor, previews and extents agree; the fill/stroke split
  under layer effects starts from the whole shape's transform.
- Removed pixel_align.rs, the rasterizer helpers it needed, the document-space
  drag preview and psd_coordinate_frame (rounding the bounds absorbs the PSD
  quantization it was for).
- One Align Edges checkbox (ToolOptions::align_edges, stored and scripted as
  useAlignedRendering, older align_edges still read) on every shape tool and the
  Pen, on by default and after Reset Tool; it snaps the drag and sets the layer.
- PSD sn2P: written as 1 when on and left out when off, as the reference saves it.
- Dropped the dead path.set param, moved the control-protocol paragraph,
  rewrote docs/pixel-aligned-strokes.md, reverted the unrelated raw, font,
  Cargo and test-harness changes.
- Tests reproduce the measured cases (rectangles at .25/.4/.5/.6/.75, ellipse
  extremes and curve symmetry, 1/2/3 px strokes, rotated rect, Pen triangle,
  two subpaths, toggle off, stored path unchanged, one checkbox, Reset Tool).

Co-Authored-By: superplay2021 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 13:02:42 +01:00
hnoerenberg 818a4a010d feat(doc): patterns record the colour mode they were defined from
Edit > Define Pattern composites the area in the document's pixel format, which stores an Indexed Color document expanded to RGB. Nothing on Pattern said where the tile came from, so a pattern taken from an Indexed image was indistinguishable from an RGB one, and a tool that cares about the difference had nothing to read.

The new field names the source mode. The pixels, the id and what the pattern library lists stay as they were. A pattern read from a file records no source: a .pat or PSD block says what its pixels are, not which document they came from. The library index and .pcraft carry the field, so a defined pattern keeps its source across a restart or a save; files written before it read as no source.
2026-11-24 11:22:16 +01:00
superplay2021 47790f5e0d Merge latest main and resolve Align Edges conflicts 2026-11-23 21:25:02 +02:00
David Mann 6554712c61 Merge pull request #16529 from davidmann4/batch-19-prs-restored
Batch: 19 PRs with fix-ups (#12219, #11835, #14491, #15187, #8222, #15796, #15085, #15308, #15311, #15435, #14650, #15921, #15515, #15632, #15948, #15653, #14493, #14492, #14748)
2026-11-23 19:27:50 +01:00
skylartaylor 5cd4bc3d1c Merge main into nightly/windows-flavor (picks up #16483) 2026-11-23 05:57:20 +01:00
Higgs32584andClaude Opus 5.5 b0e95488da Merge upstream main into fix/8047-channel-mixer-cmyk
Keeps both test modules in crates/format/tests/it/main.rs: main's camera_raw_roundtrip and this PR's channel_mixer_cmyk.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-22 12:56:48 -05:00
David Mann 71495f89e5 Merge remote-tracking branch 'origin/main' into HEAD 2026-11-22 12:23:08 +01:00
Dylan M. Taylor f3f382697f test(raw): pin pre-cutover Camera Raw SmartFilter and filter baseline (#587) (#16028)
* test(raw): pin pre-cutover Camera Raw SmartFilter and filter baseline (#587)

* test(format): avoid json! macro recursion limit in camera_raw_roundtrip (#587)

* test(format): wrap SmartSource::Embedded bytes in Arc (#587)

* test(engine): use select.deselect in camera_raw_baseline_pin (#587)

* test(raw): capture legacy RAW Open and Camera Raw Filter pixel baselines (#587)

* test(raw): lock Camera Raw Filter baseline pixels and capture RAW Open values (#587)

* test(io): lock legacy RAW Open baseline pixels (#587)

* test(io): capture RAW Open camera WB legacy baseline pixels (#587)

* test(io): lock RAW Open camera WB legacy baseline pixels (#587)
2026-11-21 19:59:28 -05:00
David Mann afacff50ea Merge PR #15143: fix(format): respect chosen chunk size in read probes 2026-11-22 00:25:40 +01:00
skylartaylor 753a81f637 Preserve bounded prerelease writer information in newer-file errors
Keep actual format compatibility as the decision; no format bump or file migration. Shared build override identifies the writer; bounded escaped diagnostics retain ordinary full tags. Three real manifest regressions authored, unrun; applicable crate validation pending.
2026-11-21 09:47:38 +01:00
Higgs32584andClaude Opus 5.5 3356714009 Merge upstream main into fix/8047-channel-mixer-cmyk
Resolve the conflict in crates/engine/src/adjust_params.rs: keep this
branch's generic mixer_row (RGB rows of 4, ink rows of 5) and main's
rounding to whole percentages before clamping (#14414).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-20 18:57:10 -05:00
superplay2021 31de878f08 Merge latest main and resolve Align Edges conflicts 2026-11-20 04:44:04 +02:00
David Mann a1b93266a9 Merge #14481 into the merge queue batch
Color Table: recolour by index, black past a shrunk table (#14342)
2026-11-19 22:27:46 +01:00
Michael Higgins 9888613806 Merge branch 'storytold:main' into fix/8047-channel-mixer-cmyk 2026-11-19 10:19:01 -05:00
aiongg 5e6d342b36 Merge pull request #15718 from FredApps/fix/15708-deterministic-spill
Give scratch tests a deterministic volume capacity
2026-11-19 09:58:09 -05:00
aiongg a8f95bd16d Document layer index and index-ordered selection (#15704)
Document.layers is a LayerTree that builds an id index on first lookup and drops it on any mutable access. Layer lookups and selected_layers use the index instead of walking the document.
2026-11-19 10:07:19 +00:00
FredApps 236bc84a5e Give scratch tests a deterministic volume capacity 2026-11-19 08:01:25 +01:00
David Mann 2cda31cd8d Merge remote-tracking branch 'origin/main' into test-speed/15652-unclaimed-slow-tests
# Conflicts:
#	crates/gpu/tests/it/camera_raw.rs
2026-11-19 00:31:06 +01:00
David Mann 3f9495d2e6 Merge remote-tracking branch 'origin/main' into HEAD 2026-11-18 23:10:10 +01:00
David Mann 1fb5b51051 Merge remote-tracking branch 'origin/main' into test-speed/15652-unclaimed-slow-tests
# Conflicts:
#	crates/ui-egui/tests/it/batch_export_options.rs
2026-11-18 22:14:41 +01:00
David MannandClaude Opus 5.5 493d2df62f Tests: trim the loops of the unclaimed slow tests that reach no new code (#15652)
Each removed variant takes the same branch as one that stays, or is covered without the app or
oracle cost by a named lower-level test; the commit's comments say which for every test.

ui-egui: floating-document zoom (10 frames after Enter, not 60), Wide Angle (one depth per mode,
alpha kept), Brush panel sections (only those Brush Settings draws; Brushes ignores the section),
Camera Raw GPU (8 and 32 bits), enable rules (one app per world, a copied style for Paste only),
Content-Aware Move preview (selection just past the coarse budget, smaller canvas).
algo/compose/engine/gpu/format: Pixelate (Lab, cell 100, seed 37, tile 1), box blurs (Gaussian
40), Smart Blur (multichannel layouts cover every arm; Low and High), FFT sharpen gate (one
depth), panorama batching (budgets at every split instead of a 47-step sweep), bevel and chisel
threads (2 and 16), fused tone tiles (256 x 256, the U16 table threshold), live dabs (8 and 32
bits), Camera Raw GPU sizes (1600 x 240 wide case; the proxy-size per-pixel run lives in the
clarity test), directory bundle (two modes; zip_cases has the matrix).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 22:14:12 +01:00
aiongg 0081fd10e1 Tests: merge single-file integration test binaries into one binary per crate
Each crate's top-level tests/*.rs files become modules of tests/it/main.rs, and a new xtask check (test-binaries) refuses a new single-file test binary.
2026-11-18 19:11:27 +00:00
Zaxaerith 5ebc3b4cc9 fix(format): drop unused photocraft-formats dependency (#15468) 2026-11-18 20:22:34 +08:00
Higgs32584andClaude Opus 5.5 25ced89e43 Merge upstream main into fix/8047-channel-mixer-cmyk
main (#15449) moved the adjustment editors onto the craft UI framework and deleted basic.rs, which held this PR's CMYK Channel Mixer editor. The framework ChannelMixer has red, green and blue rows only, so a CMYK mixer is now kept out of it: values::from_params refuses a mixer with ink keys (CMYK_MIXER_UNAVAILABLE), the Properties panel shows that message and edits nothing, and Image > Adjustments > Channel Mixer refuses to open in a CMYK document with the same reason. A CMYK editor in craft-libs is the follow-up.

ui_tests.rs keeps main's tests; the test of the deleted egui editor is replaced by cmyk_channel_mixer_is_kept_out_of_the_rgb_editor, and the every-kind Properties test expects the refusal for a CMYK mixer. The Tokens::mixer_rgb/mixer_ink fields added for the deleted editor are dropped (no user left).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 11:47:59 -05:00
superplay2021 b76163ff1f Merge latest main and reconcile RAW adapter fixes 2026-11-16 12:56:05 +02:00
David Mann 5e5f2dc8d9 Merge main into fix/8047-channel-mixer-cmyk 2026-11-15 20:30:30 +01:00
Mex e61766d32c fix(format): respect chosen chunk size in read probes
Cap EOF and growth probe reads at the normalized chunk size. Add a bounded-reader regression covering zero, short and full probe sizes and missing, partial and exact length hints.
2026-11-15 15:12:58 +01:00
superplay2021 e5f7ba37b9 Merge latest main and reconcile RAW and format fixes 2026-11-15 15:06:56 +02:00
Dylan M. Taylor 2a0e50526f Merge main CI repairs while preserving shared RAW and SVG adapters
Reconcile contributor #14595 fixes with #15036: retain bounded SVG refusal reclassification and shared preflight, distinguish corrupt reads from save I/O failures, preserve RAW calibration and stricter regression cases. Keep newer descendant shared pin and main GPU/test support fixes. Hosted validation required.
2026-11-15 07:43:37 -05:00
Sven Lafebre e2cb5a0cf5 Color Table: keep each pixel's index where it is known
Indexed Color documents store RGB pixels, so Color Table found each
pixel's index again as the nearest entry, and entries of one colour
lost their own pixels (#14342). The document now keeps each pixel's
index (Document::color_indices) where it is known: recorded when a
palette PNG is opened, by Image > Mode > Indexed Color and by Color
Table itself. Color Table uses it while the layer still has exactly the
recorded tiles; after any other change it maps by nearest colour as
before. A known index past a shrunk table stays black until the table
grows back over it.

The native format saves the indices only while they hold for the layer
as saved, and pairs them with the loaded layer on open.
2026-11-15 10:50:12 +01:00
Terra854 274c99f94d Complete shared-format migration and fix RAW/SVG review findings 2026-11-15 15:05:47 +08:00
superplay2021 d7a993ac7a Merge main and fix SVG and native-format CI regressions 2026-11-14 23:30:08 +02:00
David MannandClaude Opus 5.5 4371b60459 format: fix the .pcraft store tests left red by the craft-libs bundle migration
- refuse a symlinked or non-file manifest.json before any object is written
  (craft-pcraft-bundle only refuses it when it publishes the manifest)
- a directory save reports craft-pcraft-bundle's Io errors as I/O, not as a
  corrupt bundle (a locked manifest said "corrupt .pcraft bundle")
- a full_composite member naming another entry refuses the bundle, as
  craft-pcraft-format already does for thumbnail and composite
- the permission tests make the tiles/blobs/composite folders they restrict;
  an empty document's save no longer creates them

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 15:49:55 +01:00
superplay2021 3db0c99fe5 Merge main and fix Align Edges integration 2026-11-14 14:08:31 +02:00
Hasan-Zayni 3a7e13cd33 format: report a ZIP member over its read bound as LimitExceeded
craft-libs' bundle reader returns Error::Zip(EntryTooLarge) for a member past its read bound; map it through zip::map_read_error so it surfaces as LimitExceeded, not Corrupt. The directory cleanup test now creates tiles/ and blobs/ itself, since an empty document's save no longer makes them.
2026-11-14 13:07:06 +03:00
Dylan M. Taylor 4ab4b0ad07 format: align store tests with craft-pcraft-bundle 2026-11-14 04:07:44 +00:00
Dylan M. Taylor b0e0bcc6c4 Merge pull request #14236 from storytold/codex/photocraft-format-migration
Move remaining file formats and codecs to craft-libs (#778)
2026-11-13 23:03:16 -05:00
Gabriel Heuser 239a1c49c9 Merge branch 'main' into fix-pixel-aligned-shape-strokes 2026-11-13 23:31:44 +02:00
Trevor BrownandClaude Sonnet 5.5 cbd389a504 Triangle tool: tests for hostile and degenerate boxes and for the triangle_live field (#13350)
The hostile-radii test now tells the command guard's internal error from a graceful one, and a new test sends hostile boxes. The vector tests pin zero-size, sliver and tall thin boxes. The format tests cover both fields present, a field holding another kind, and junk in triangle_live.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Model-Effort: Opus 5.5 drove; Fable 5.2 briefed; Sonnet 5.5 wrote at medium
2026-11-12 20:19:03 -05:00
Trevor BrownandClaude Sonnet 5.5 303be52228 Triangle tool: the triangle fills its box, as its own live kind (#13350)
A new live shape kind, LiveShape::Triangle { rect, corner_radius }, draws an isosceles triangle that fills the dragged box (apex at the top centre, then bottom right, bottom left). The engine no longer turns a triangle into an inscribed 3-sided polygon. Triangles saved before this are 3-sided polygons and keep that geometry.

The .pcraft manifest stores a live triangle in a new optional triangle_live field beside live (as arrow_live does), so older builds open the file and show the saved path. PSD export writes no vogk for a triangle, as for polygons.

Arms the new kind forces: live_kind, the axis-aligned transform, params, the corner radius widgets and the Properties Shape section (Corner radius only). Shift keeps today's equilateral triangle, sent as its tight box.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Model-Effort: Opus 5.5 drove; Fable 5.2 briefed; Sonnet 5.5 wrote at medium
2026-11-12 19:27:36 -05:00
RickiNano e660b4906b Clear the clippy 1.100 lints that fail the gate on main (#13531) (#13535)
* Clear the clippy 1.100 lints that fail the gate on main (#13531)

Clippy 1.100.0 flags needless_range_loop in cms synth.rs (the gate
failure on main), algo photo_util.rs and an engine multichannel test,
and, on Windows only, needless_bool in format noreplace.rs, where the
cfg(unix) branch compiles away. Each loop now iterates the slice it
indexed, with the same values in the same order.

* Clear the Linux-only clippy 1.100 needless_bool lints (#13531)

paths_match in ui-egui and is_redirect in the app ended with a
cfg(not(windows)) branch that is just `false`, which clippy 1.100
flags on Linux. Each platform's branch now returns the whole
comparison: the same results, in the same order.
2026-11-12 14:56:57 -06:00
Gabriel Heuser d186d8cb16 Merge branch 'main' into fix-pixel-aligned-shape-strokes 2026-11-12 07:58:40 +02:00
Dylan M. Taylor f373ec181c fix(format,engine): limit zstd windows, set bundle modes via the handle, refuse symlinked presets (#11145)
* fix(format): limit zstd windows, set bundle permissions through the handle, refuse symlinked presets

* test(engine): create the symlink test's directory

* address review: preset writes never follow a symlink swapped in after the check

* address review: a zstd window past the limit is a limit error; replacing a link never reads its target's attributes

* test: replacing a link to a FIFO does not block
2026-11-11 16:29:17 -05:00
Dylan M. Taylor b01e6c0270 Save: a replacement in another group does not widen group access (#11232)
* Save: a replacement in another group does not widen group access

* address review: set the group before copying extended attributes; skip the group test when the original's group is not assignable

* address review: copy the permissions (minus group bits) when the group lookup fails
2026-11-11 16:26:21 -05:00
Higgs32584 8b59836fd4 Merge upstream main into fix/8047-channel-mixer-cmyk 2026-11-11 13:26:25 -05:00
d4f570a6bf Name leftover staging files and keep staging exhaustion distinct (PR #11577 review)
Running out of staging names returned AlreadyExists, which the
PublishNewError docs tell callers to read as "destination taken, pick
another name". It is now a plain error. When the staging cleanup retry
fails too, the error names the leftover staging file. rename_noreplace
documents that it renames files only.

Co-Authored-By: yoriswind <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-11 17:04:27 +01:00
David Mann 5585ad6407 Merge remote-tracking branch 'origin/main' into pr-11577 2026-11-11 17:01:34 +01:00
Dylan M. Taylor 8ef148ace9 Recovery: replace a symlinked sidecar and do not sweep through symlinked bundle folders (#11230)
* Recovery: replace a symlinked sidecar and do not sweep through symlinked bundle folders

* address review: remove a directory symlink at the sidecar path with remove_dir on Windows
2026-11-11 08:38:40 -05:00
superplay2021 20ca04c875 Merge main and preserve Pen reset options 2026-11-11 12:36:18 +02:00