Commit Graph

2979 Commits

Author SHA1 Message Date
Dylan M. Taylor 840594f96a security/meta,merge,raw,tiff,denoise: bound memory sized by attacker-shaped inputs
XMP flattening, sparse-focus EXIF decode (plus the maker-note and TIFF value
budgets), lossy-DNG chunk staging, panorama stitch frames, the reference ONNX
executor's tensors and the denoise product reader all now reject or cap what a
malformed file can make them allocate: each result is checked before the
memory behind it is reserved, every regression carrying a test that fails
without its bound.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-10-24 05:17:19 -04:00
Dylan M. Taylor 9319ab7bea security/raw: bound hostile-memory paths in raw decoders
Sparse walkers, truncated MEF/lossy-JPEG strips, embedded JPEG sizes, the
CR3 preview marker walk, OpcodeList3 full-image passes and caller-supplied
Deflate tile edges each let a small file or one bad argument multiply
allocations or CPU work thousands of times. Each path now is bounded,
every fix with a regression test that failed (or blew up) before it, plus
a tiff::image single_chunk helper so preview extraction never builds a
descriptor vector for a hostile multi-strip layout.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-10-24 04:13:32 -04:00
Brandon Thomas 1acd2938ea Merge PR #2546
# Conflicts:
#	docs/gaps.md
#	docs/parity-checklist.md
#	docs/whats-new.md
2026-10-23 17:21:18 -04:00
Brandon Thomas 708e8a8bfc Merge PR #2688
# Conflicts:
#	docs/parity-checklist.md
#	docs/whats-new.md
2026-10-23 17:21:17 -04:00
Brandon Thomas 92bd08ba5c Merge PR #2618
# Conflicts:
#	docs/whats-new.md
2026-10-23 17:21:17 -04:00
Brandon Thomas bbf9b713f2 Merge PR #2526
# Conflicts:
#	docs/gaps.md
#	docs/parity-checklist.md
#	docs/whats-new.md
2026-10-23 17:21:17 -04:00
Brandon Thomas e700170dc6 Merge PR #2727
# Conflicts:
#	docs/parity-checklist.md
#	docs/whats-new.md
2026-10-23 17:21:17 -04:00
Brandon Thomas 0605272e69 Merge PR #2620 2026-10-23 17:21:16 -04:00
Brandon Thomas 4d9914d4db Merge PR #2709 2026-10-23 17:21:16 -04:00
Brandon Thomas 652fa88c12 Merge PR #2670 2026-10-23 17:21:16 -04:00
Brandon Thomas d7763492c4 Merge PR #2210 2026-10-23 17:21:16 -04:00
Brandon Thomas a344e277f0 Merge PR #2728 2026-10-23 17:21:16 -04:00
Brandon Thomas 433ce2375d Merge PR #2109 2026-10-23 17:21:16 -04:00
Brandon Thomas 8c52e2ee95 Merge PR #2630 2026-10-23 17:21:16 -04:00
Brandon Thomas 3ab88f50ac Merge PR #2612 2026-10-23 17:21:16 -04:00
Brandon Thomas cb94eb0e3a Merge PR #2626 2026-10-23 17:21:16 -04:00
Brandon Thomas 4f30720374 Merge PR #2702 2026-10-23 17:21:16 -04:00
Brandon Thomas 6a9e1b504f Merge PR #2694 2026-10-23 17:21:16 -04:00
Brandon Thomas d9db2d32e7 Merge PR #2596 2026-10-23 17:21:16 -04:00
Brandon Thomas e44cbc8725 Merge PR #2543 2026-10-23 17:21:16 -04:00
Brandon Thomas 5e5602b4ca Enable Filters: Find Similar turns filtering back on; a filter put aside follows renamed keywords, people and folders
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 17:20:11 -04:00
Brandon Thomas 089bf60ede Colour-range mask: mask.update caps the samples too
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 17:13:39 -04:00
Brandon Thomas 4d3ea22e9c Masking: drop the one-off overlay screenshot example and its png dev-dependency
Keeps CanvasMap::new and mask_overlay private to detail.rs again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 17:06:43 -04:00
aiongg b264557916 i18n: missing translations are reported, never a failure (#2729)
A message a catalog lacks, or translates as an empty string, shows in
English and fails nothing:

- build.rs no longer requires every formats catalog to carry the same
  messages, and tr_format! gets a last arm that formats the English
  source, so a message no catalog has builds.
- Coverage tests (every language translates X) and tests of one
  language's exact wording are gone; the language-switching, layout,
  date, placeholder and user-value tests read the catalog's own value
  instead of a hard-coded translation.
- i18n::tests::translation_gaps_report lists, per language, the plain
  and format messages it lacks and its untranslated What's New lines.
  It always passes; cargo xtask ci
  runs it from the test step's binary after the tests.
- catalogs_load checks that every catalog file is a JSON object of
  strings with each key once; it.json named "Dimensions" twice.
2026-10-23 16:42:28 -04:00
aiongg d71b83b2bc Catalog import: resolve catalog paths with craft-docpath's resolve_absolute (#2412)
doc_path::resolve uses craft_docpath::resolve_absolute; a path that resolves but is not absolute here is reported as not on this computer. Adds tests for Windows-form, GVFS-relative and colon-in-name paths, and a git-sources check in nix.yml and release.yml.
2026-10-23 16:42:09 -04:00
NetterSilver c7cff2d9a7 Fix smart album gte/lte rules missing equal f-number and focal length
Found while testing crates/catalog/src/rules.rs:673 (num_op), reached via Rule::matches at :956-957

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-23 21:24:32 +02:00
Nathaniel Ledford aae03c8f47 LR-BEHAV-ACCESS: Tab leaves the name field of a dialog
dialog_field took the focus back every frame while the field wasn't being edited, so Tab never
reached the check box, Cancel or OK of New Album, New Smart Album, Save Metadata Preset and the
other one-field dialogs. It now takes the focus once, when the dialog opens (the way the keyword
dialogs already did).
2026-10-23 15:20:09 -04:00
Nathaniel Ledford f0cdb20a86 Tests: a photo chosen during an import is chosen while the import is held, not while a clock runs 2026-10-23 15:10:15 -04:00
Marco Arnulfo b6d94b447b Drop a removed folder from the filter Enable Filters put aside 2026-10-23 19:35:06 +02:00
aiongg f3bb7a9f30 CI: one test binary per crate, line tables only, one WASM check (#2710)
* CI: dev profile keeps line tables for workspace crates and no debug info for dependencies

* Control server tests: persistent_requests_and_slow_replies_outlive_the_idle_read_timeout no longer races the idle timeout

Each request (and the closing half-shutdown) reaches the socket before the
worker reads, so on a slow machine only the reply waits outlast the 100 ms
idle timeout, as the test intends. The idle test sends its input the same
way, and the no-frames test allows 5 s instead of 2 s to give up.

* CI: one integration-test binary per crate

Each crate's tests/*.rs become modules of tests/it/main.rs (51 test files
into 13 binaries, plus 6 that stay their own). Inner #![cfg] attributes
move to the mod lines. Files that change state for the whole process keep
a binary of their own: codecs jxl_tail_heap and raw sr2_heap (dhat global
allocator), gpu shutdown, shutdown_first and memory, ui-egui shutdown.
Docs, comments and the GPU probe name the new paths and targets
(--test it <module>::); the CI report names an it binary's skips after
the crate.

* CI: tests under nextest, doctests apart, one wasm check

xtask ci runs the tests with cargo nextest run --lib --bins --tests when
cargo-nextest is installed, else cargo test with the same targets and a
one-line notice; doctests run after them with cargo test --workspace --doc.
The heif and hardware GPU steps use the same runner. Examples stay out of
the test build (clippy --all-targets still checks them). Concurrent tests
under nextest follow the RUST_TEST_THREADS cap (NEXTEST_TEST_THREADS).
The wasm check is one cargo check --keep-going over the same crates, and
clippy runs with --keep-going.

* CI: tests run under cargo test by default, nextest with LIGHTCRAFT_NEXTEST=1 (per-process scene cache)
2026-10-23 13:34:30 -04:00
Marco Arnulfo 6c55a76e95 LR-LIB-FILTER: Cmd+L / Ctrl+L (View > Enable Filters) switches the library filter off and on again as it was 2026-10-23 17:38:34 +02:00
Dylan M. Taylor 6fb6815cd9 fix: document the deliberate buffer leak during thread teardown (SonarCloud)
Dropping a wgpu buffer after the device's thread-locals are gone can
abort; the device owns the memory either way.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-10-23 09:44:05 -04:00
Nathaniel Ledford 63f4a3197d LR-META-LOCATION: no test starts the GeoNames download
The command sweep ran metadata.downloadPlaceNames with empty params, which
starts a real download from download.geonames.org into the settings folder.
The sweep now skips it (the command has its own loopback-server tests) and
asserts that no place names download was started.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-23 09:43:44 -04:00
Nicolas Falesy 5407888184 perf(pipeline): Highlights/Shadows median about 2x faster on the CPU, bit for bit the same
`median_row` (the running median under process V2's highlights/shadows base) kept a sorted
window of f32 and, per pixel, found the leaving and entering values with two binary searches
on `total_cmp`, then `remove` + `insert`. The searches mispredicted on most steps.

Now the window holds `i32` keys that order exactly like `f32::total_cmp` (the same transform
it applies), both ranks come from one branch-free counting pass the compiler vectorizes, and
one `copy_within` moves the keys between them. Equal keys are equal bits, so the output is
unchanged bit for bit.

24 MP Sony A7 III log luminance, one P-core, interleaved: r = 9 (export) 1977-2027 ms ->
912-958 ms, r = 3 1249-1292 -> 658-724, r = 24 2180-2261 -> 972-1030. All cores, r = 9:
170-188 -> 86-102 ms. The GPU path has its own median and is untouched.

New test: special values (NaN of both signs, signed zeros, infinities), long ties and planes
narrower than the window match a per-pixel sorted median bit for bit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0121DZuByhKyGLHw5C9JkUue
2026-10-23 08:43:08 -04:00
Matej Vrzala dadb0dfc79 Colour-range mask: cap the number of samples from automation
A colour-range mask compares every pixel against every sample, so
render and export cost is pixels x samples. The interactive sampler
stops at 5, but mask.add / mask.update (colorRange) passed their
`samples` array straight through, so a few hundred samples on a large
render turned into billions of operations and hung rendering and
export. The project already caps similar lists (MAX_STROKE_DABS,
MAX_DETAIL).

The samples list from automation is now capped at 64.

Test: a request with 1000 samples is cut to 64; a two-sample request is
unchanged.

Reported-by: BS.ehlas.cz
2026-10-23 09:46:14 +02:00
skylar taylor-barrick 12ca4cc65b #49: test that the in-window menu headings are spaced apart
The File/Edit/View headings sat only egui's default 8 px apart because frameless
buttons get no padding of their own. The test lays out the in-window menu bar and
checks every pair of neighbouring headings is at least 24 px apart; without the
item-spacing fix the gap is 4 px and the assertion fails.
2026-10-22 17:31:42 -06:00
Clyde C Brown b84d9a8cff #2625: view.maskOverlayColor refuses signed hex digits
parse_rgb checked only the length, and u8::from_str_radix accepts a
leading '+', so "#+f+f+f" set the overlay to #0f0f0f. Require six hex
digits, as 80e439f6 does for the other #rrggbb parsers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:40:49 -06:00
ingolfteetz 693c35931d LR-CROP-AUTO: Auto straighten turns by at most 10° on at least 3 lines, and says when it finds nothing
Measured on 68 photos straightened by hand in Lightroom Classic and 300 left as shot, Auto
straighten turned 79 of the 300 by more than 1° (65 by more than 2°): the edges of planks, a
branch or a bird's wing were taken for the horizon. It now answers only for at most 10° and on at
least 3 agreeing lines (Upright Level is unchanged): 19 of the 300, with the same 14 of the 68
levelled within 0.5° and 1 instead of 3 more than 1° off. When it finds nothing, the app says so
instead of leaving the photo without a word. LR-CROP-AUTO goes to 🟡: it still leaves most tilted
photos alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 22:36:41 +02:00
francoisgn 98189d5311 Corpus tests: the Z 8 / Z 6II profile tests pair through the lens warp; Hasselblad TIFF previews pass
Two corpus tests fail on main with the CC0 corpus present (they skip without it, so no CI
has run them):

- camera_preview::tests::corpus_z8_uses_the_bundled_profile / corpus_z6ii_…: the test fitted
  the camera look with `lens: None`. Since 1ee751ebd (Nikon's in-file distortion for the
  Z 6II and Z 8, the same day as the tests) the camera's JPEG is matched through that warp,
  which files.rs reads with `lens_geometry` and removes from the opcodes before binning the
  proxy. The test now does the same; the app path was right all along.
- corpus_raw_decodes: coverage-1639.fff has no JPEG and hands on its 8-bit RGB image as a
  baseline TIFF (`rgb_preview`, b5dc500c5); the test only accepted JPEG / JPEG XL previews.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 23:30:04 +03:00
Clyde C Brown f6a4770cf2 #2617: Find Missing matches Windows paths' file names on macOS and Linux
Find Missing Photos took a missing photo's file name with Path::file_name,
which doesn't split on `\` on macOS or Linux, so a library made on Windows
had photos it could only find by content: those with no hash on record
(Lightroom-catalog imports, files edited since) were never found. Both the
missing photos and the files found on disk are now named by one rule: the
part after the last `/` or `\`, in lower case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 13:31:51 -06:00
Matej Vrzala ffb57d1a9b Library lock: Don't write through a link at the owner note's name
LibraryLock::acquire wrote catalog.lock.owner with std::fs::write,
which follows a symlink at that name. A library folder someone else
prepared (a shared drive, an unpacked archive, a synced folder) could
carry catalog.lock.owner -> ~/.bashrc or any other file the user can
write, and opening the library replaced that file's content with the
owner JSON. The catalog's staging files had the same problem and were
fixed in #1502; the owner note was missed.

The note is now written through store::create_staging (made
pub(crate)): whatever is at the name is removed (a link itself, never
its target) and the file is created with create_new. Drop already
removed the note with remove_file, which never follows a link.

Test (Unix): a link at catalog.lock.owner pointing at a file outside
the library leaves that file's bytes unchanged through acquire and
drop, and the note lands in the library as a regular file naming this
process.

Reported-by: BS.ehlas.cz
2026-10-22 18:39:33 +02:00
ronibalthazar 36d6762f08 #2519: reject invalid UTF-8 in PSD XMP resources 2026-10-22 16:15:39 +01:00
ronibalthazar 26a24eb22e Fail closed on malformed PSD XMP and duplicate resources 2026-10-22 15:48:40 +01:00
ronibalthazar d18fb06aa8 Fail closed on malformed PSD EXIF during extraction 2026-10-22 14:59:39 +01:00
ronibalthazar c8390afbd2 Fail closed on malformed PSD metadata during original export 2026-10-22 14:21:32 +01:00
ronibalthazar 6413bccbfd #2519: read PSD and PSB metadata 2026-10-22 11:20:53 +01:00
NetterSilver 9458e2c59a Take photos removed by Synchronize Folder out of their stacks
Found while testing crates/engine/src/sync.rs:851 (SyncStep::Remove; compare mark_deleted in crates/engine/src/cmd/library.rs:168)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 11:41:53 +02:00
ronibalthazar 8d4e6e1e01 LR-META-XMP: preserve foreign namespace collisions 2026-10-22 06:42:11 +01:00
aiongg 3dd1b88ff9 Merge PR #2349: the sidebar trees narrow their indent step before names are cut (test follow-ups) 2026-10-22 03:45:54 +00:00
aiongg 1847cbd3e3 Integration: #1997 test picks the 3:4 crop by its named ratio, which follows the photo's orientation 2026-10-22 03:28:46 +00:00