Commit Graph
2488 Commits
Author SHA1 Message Date
Bruno-Alumn 1c906ea3db Never crash: strip byte counts near u64::MAX don't overflow their sum in ORF, SRW, ARW and PEF
The TIFF reader accepts LONG8 (type 16) StripByteCounts in classic
TIFF, so a file can declare strips of u64::MAX and 1 bytes. The ORF,
SRW, ARW and PEF decoders added the strip lengths with
Iterator::sum::<u64>(), which panics on overflow in debug builds. They
now add them with a saturating fold, as raw/src/lib.rs already does,
so such a file is refused or read as far as its data go.

The tests rewrite a synthetic file of each decoder into two strips
with LONG8 counts [u64::MAX, 1] (vendor::tests::huge_strip_counts);
PEF is checked for the Huffman-coded and the uncompressed path.
2026-10-30 13:37:16 +01:00
Bruno-Alumn bc12ec8e40 Never crash: a mask id at the u32 limit doesn't overflow the next mask's id
Mask ids come unchecked from develop.merge, sidecars (lc:settings) and
pastes. With a mask id of u32::MAX, next_mask_id() and Preset::apply
added 1 to it: debug builds panicked, release builds wrapped to 0, so
the second new mask got the same id as the first.

next_mask_id() now falls back to the lowest id no mask uses when the
highest is at the limit, and Preset::apply takes each preset mask's id
from it instead of counting on its own, so mask.add, mask.brushStroke,
mask.duplicate and presets with masks all get unused ids.
2026-10-30 13:31:01 +01:00
Bruno-Alumn cfbd109534 LR-MASK-OBJECTS: a SAM 3 checkpoint in Meta's original format is named as such, not as an unsupported dtype (#3378)
The sam3.safetensors on community mirrors (AEmotionStudio/sam3,
1038lab/sam3) is a conversion of Meta's original sam3.pt: its tensors
keep Meta's names, and its RoPE tables are C64. Renamed to
model.safetensors, it failed to load with "unsupported dtype
Some("C64")", which read like a LightCraft limitation.

Weights::open now lists a tensor of another dtype instead of failing
the whole file; reading it fails with the dtype error (LightCraft
computes RoPE itself and never reads those tables). Sam3::load_on then
checks the format: when the backbone's first tensor in Hugging Face
naming is missing and the file has Meta's detector.backbone. or
tracker. tensors, the error says it is Meta's original checkpoint and
that model.safetensors from facebook/sam3 in the Hugging Face format
is needed. docs/ai-masks.md says so for installing by hand.
2026-10-30 13:25:37 +01:00
Bruno-Alumn 06e2ec43ba LR-MASK-COLORRANGE: a colour-range mask keeps at most 64 samples however it is loaded (#2556)
Render cost is pixels x samples (CPU and GPU), and only mask.add / mask.update capped the list, so a
sidecar's lc:settings, a preset, develop.merge, render --settings or a catalog / history load could
carry thousands and stall a render or lose the GPU device. MAX_COLOR_RANGE_SAMPLES moves to
lightcraft-develop and ColorRange::samples deserializes through a capped visitor (the first 64 in
order, the rest skipped as IgnoredAny); the CPU and GPU renders also take at most 64 for settings
built in code.
2026-10-30 12:03:03 +01:00
Bruno-Alumn afee9df020 LR-IMP-FORMATS: a Samsung panorama JPEG with its SEF trailer imports (#3350)
Some Samsung panoramas have no end-of-image marker: the scan data runs
straight into the SEF trailer at the end of the file, so the header
check refused them as truncated, and jpeg-decoder (DCT-scaled previews)
and zune-jpeg both fail on the trailer's bytes after the scan.

When the file ends with a valid SEF trailer (SEFT, a directory length
that points at SEFH, a sane entry count, every entry's block inside the
file before SEFH) and no EOI is reached, the image is read as the bytes
before the earliest SEF block plus an EOI, for both the header and the
decode. The cut must fall in scan data after the first SOS; a JPEG cut
short without such a trailer is still refused.
2026-10-30 10:25:32 +01:00
FredApps 1d7d188846 Reconcile shutter precision with split import/export modules
Preserve main's module boundaries and current metadata behavior. Move the shutter changes and regressions into the corresponding probe, encoding and test modules. Preserve both parity records. Hosted CI must validate this refreshed head.
2026-10-30 08:13:52 +01:00
Chad ElliottandClaude Opus 5.5 a31a43670b fix(lightroom): content duplicates start from import defaults; Show in Library skips Recently Deleted (#2589)
A catalog photo whose bytes match another library photo got the generic develop defaults, so a raw
with no white balance or lens setting in the catalog lost its as-shot white balance and embedded
lens corrections and rendered unlike a file import. It now gets the import defaults (camera
defaults plus the default preset), as a file import does, before the catalog's settings go on top.

Show in Library selected the lowest mapped photo id, which can be a master left in Recently Deleted
whose new virtual copy the import added; All Photos doesn't show it. It now selects the lowest
mapped photo not in Recently Deleted, and the button is left out when there is none.

Tests: a content-duplicate raw with no catalog settings equals its camera defaults (as-shot WB,
lens profile on); Show in Library skips a trashed mapped photo and offers nothing when only
trashed or vanished ids are mapped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 23:56:50 -05:00
Marco Arnulfo 1ee9991b41 LR-FILT-FLAG: the filter bar's flag buttons combine, Picked + Unflagged hides only the rejects (fixes #2588) 2026-10-30 02:26:41 +01:00
Bruno-Alumn 8b3d56142a LRC-LIB-FOLDERS: Move Folder To… waits while Open Library… or New Library… asks for a folder (#3140) 2026-10-30 02:22:08 +01:00
Bruno-Alumn cb841a3fe1 LR-MASK-PINS: with the Object tool on, a click on the selected mask's own pin adds no Object click (#3049) 2026-10-30 02:13:07 +01:00
Bruno-Alumn a48449a527 LRC-LIB-CATALOG-SWITCH: a remembered library that can't be read is reported as unreadable, and why it's missing is translated (#3239)
The reasons Try Again and the launch check give for a missing remembered library are now in the
interface language (all 17 catalogs). A folder that can't be looked into (no permission, a share
that timed out) is no longer called gone: lightcraft_engine::library::library_state tells a missing
catalog from a failed lookup, and the window shows the system's reason.
2026-10-30 02:09:20 +01:00
Bruno-Alumn 5d92a471de LRC-LIB-FOLDERS: no library switch while Move Folder To… waits for its destination (#3140) 2026-10-29 23:17:08 +01:00
Bruno-Alumn 7174891939 LR-MASK-PINS: with the Object tool on, a click on another mask's pin selects it (#3049) 2026-10-29 23:05:20 +01:00
Bruno-Alumn 72c44530ef LRC-LIB-CATALOG-SWITCH: Try Again on a missing remembered library makes none in an empty folder (#3239) 2026-10-29 23:01:22 +01:00
Nathaniel Ledford 08a70fa7c3 LR-BEHAV-ACCESS: the What's New entry and the revision row name the alert dialog's description 2026-10-29 14:02:02 -04:00
Nathaniel Ledford 62c3344d3c LR-BEHAV-TITLEBAR: a dialog leaves the integrated title bar undimmed
On macOS the window buttons are drawn by the OS above our content, so a backdrop over the
top bar left them bright on a dimmed bar. As under a sheet, the backdrop now stops below the
bar, the bar keeps its color with its controls inactive, a click on it is not a click outside
the dialog, and its empty space still moves the window.
2026-10-29 13:47:52 -04:00
Nathaniel Ledford bd00b6a818 LR-VIEW-HISTOGRAM: the clipping buttons' tile and chevron come from the theme and stand 3:1 in every theme 2026-10-29 13:40:14 -04:00
Nathaniel Ledford 9673a69bec PERF-SMART: test that adding or removing an album forgets the reorder guard; fix comment wording and What's New figure 2026-10-29 13:40:02 -04:00
Nathaniel Ledford 5fe7a46f58 LR-BEHAV-ACCESS: the photo in Detail is named with its file name for screen readers 2026-10-29 13:38:03 -04:00
Nathaniel Ledford 4860892332 LR-BEHAV-ACCESS: panels and bars are named as landmarks and toolbars for screen readers 2026-10-29 13:38:03 -04:00
Nathaniel Ledford c9aa1d3b81 LR-BEHAV-ACCESS: the dialog-role comments and docs say what is exposed, not what VoiceOver does 2026-10-29 13:36:43 -04:00
Nathaniel Ledford 443bc5ae03 LR-BEHAV-ACCESS: every dialog is announced as a modal dialog (an alert dialog for the prompts) instead of a group with the title 2026-10-29 13:36:43 -04:00
tylerphotosandCodex 6b1fc20053 LR-IMP-ADD-DIALOG: render import previews when the camera JPEG is too small
Require a covering embedded image only for renderable import candidates. Keep the available camera JPEG for preview-only raws and failed or unavailable render fallbacks; ordinary quick views and grid thumbnails retain their immediate stand-in behavior. Also release import preview state when canceled through the control channel.

Co-Authored-By: Codex <noreply@openai.com>
2026-10-29 11:59:23 -05:00
Nathaniel Ledford c2529503fd LR-BEHAV-DIALOGS: the Move confirm counts restored photos apart from moved ones 2026-10-29 12:22:43 -04:00
Christian BramandClaude Opus 5.5 42e54b5bb0 LR-IMP-FORMATS: decode compressed RAF 13-17 % faster with a buffered bit reader
The Fujifilm entropy reader read each unary prefix one bit at a time and refilled
its accumulator a byte at a time. It now keeps up to 64 bits buffered and counts a
prefix's zeros with leading_zeros, failing exactly where reading bit by bit would
(escape limit, end of stream). A property test checks it against reading bit by bit.

Sensor arrays are unchanged bit for bit: the 17 reference arrays of
corpus_fujifilm_compressed_samples, plus decode checksums of 20 X-Trans CMOS 4 files.
Decode on an Apple M2: X-S10 lossless 265 -> 226 ms, X-H2 448 -> 378 ms,
GFX 100 762 -> 644 ms (docs/raf-compression.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 16:36:40 +01:00
Nathaniel Ledford c32d776a0e LRC-SS-LAYOUT: the Slideshow settings page no longer moves when the slide preview finishes rendering
The preview's hint line was drawn only after the render had landed, so the pinned preview block grew by a line on the frame the render arrived (a worker thread, so any frame) and the page below it moved down. A click made in that frame hit the wrong place: the gate's tests_slideshow::playback_settings_drive_the_slideshow_and_bad_ones_are_refused clicked "Random order" and the checkbox never changed.

The hint is drawn while the preview is still rendering too. A new test holds the render back, then lets it land, and checks that the page and a control keep their places.
2026-10-29 11:14:01 -04:00
Bruno-Alumn f3b332c484 LRC-LIB-FOLDERS: Move Folder To… asks for the destination without freezing the window (#3140)
Move Folder To… in the Folders and Local menus opened the folder dialog synchronously on the UI thread, so the window stopped drawing until it closed, and on Linux X11 the app could hang. Both menus now go through the shared picker, like Import and Move to Folder…: the dialog runs off the UI thread where the host can do that and folder.move runs when it closes. The "Moved; N photo(s) relinked" message is shown either way, now translated in both menus.
2026-10-29 15:24:46 +01:00
Nathaniel Ledford 8984e385db LR-BEHAV-DRAGDROP: What's New and the parity row say that a text field's own menu still opens while photos are carried 2026-10-29 10:22:29 -04:00
Bruno-Alumn 63b7d0766e LR-MASK-PINS: Object and Describe masks show a pin that selects them (#3049)
With Show Pins on, Object and Describe masks had no pin on the photo, so they could only be picked in the Masking panel. An Object component's pin now sits at its first click and a Describe component's in the middle of what its segmentation selected. Clicking the pin selects the mask; dragging it changes nothing and adds no History step. Subject, Sky, Background, People, Landscape and the range masks still have no pin.
2026-10-29 15:04:47 +01:00
Bruno-Alumn 8ca7280e2b LRC-LIB-CATALOG-SWITCH: a library missing at launch is reported instead of being made anew with demo photos (#3239)
When the library last opened was missing at launch (its drive or network share not connected yet, or moved), LightCraft created an empty library at that path, seeded it with the demo photos and opened it. The launch plan now marks the library remembered in Settings, and when it holds no library the session opens nothing and the can't-open window offers Try Again, Choose Another Library, Continue Without Saving and Quit. The default location, --library and LIGHTCRAFT_LIBRARY are still created when missing, as before.
2026-10-29 14:53:12 +01:00
Nathaniel LedfordandClaude Opus 5.5 fec89459e0 PERF-SMART: test a smart album's rules cheapest first
A rule set is now tested cheapest rule first (numbers, choices and yes/no, then lists and
dates, then text and paths, then smart albums), worked out once per prepared filter and per
smart album, not per photo. Photos matched are the same; the editor still shows the user's order.
While a smart album tests itself, or a chain of smart albums reaches the depth limit, rules are
tested as written, since there an answer can depend on which album is asked first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 09:14:26 -04:00
Nathaniel Ledford b1d3aa8d6b Merge branch 'main' into mac-glyph-order 2026-10-29 09:08:35 -04:00
tylerphotosandCodex 8ab4641011 LR-IMP-ADD-DIALOG: finish import thumbnail sizing review (#2056)
Reconcile with current modules, preserve all locale catalogs, reuse small-source preview jobs, release dismissed review state, and keep exact-entry Escape inside the slider.

Co-Authored-By: Codex <noreply@openai.com>
2026-10-29 07:56:08 -05:00
Nathaniel Ledford f1a53e29b2 MENU-BAR: the no-photos line in the grid shows the Import shortcut as bound, in the menu bar's modifier order
The line under "No photos" spelled Cmd+Shift+I on every platform and followed no rebinding. It now goes through shortcut_text like every other place the app shows a shortcut.
2026-10-29 08:43:39 -04:00
tabasko78andClaude Opus 5.5 755bcf1bb4 FACES: review of #3286: the times in What's New are estimates scaled from 3 000 faces, and say so
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 13:34:21 +01:00
eliets2 6a7a6fa3cf docs: trim the brush note to what the change does
The gap 24 row, the change-log line and the two document headers now say only
that an extreme brush segment skips its intermediate dabs. They no longer claim
live preview, edge refinement or a mask test count, and the headers no longer
carry the unrelated gap 15 and print-page entries.
2026-10-29 13:59:18 +02:00
eliets2 bf8b5e3584 LR-MASK-BRUSH: skip the interpolation of extreme brush segments
push_dabs clamped the number of intermediate dabs of one brush segment to 1,000,000, so a
finite but extreme segment (a point 10,000,000 px away) still allocated a million dabs. A
segment that would need more than that many now keeps only its endpoints; ordinary
spacing and the segment's end point are unchanged.

Adds oversized_brush_segments_skip_intermediate_dabs, which checks both the extreme case
(2 dabs) and an ordinary feathered-brush segment (21 dabs, end point kept, spacing kept).
The docs record the fix under gap 24 and LR-MASK-BRUSH; the parity status stays partial.
2026-10-29 13:57:51 +02:00
Brain WangandClaude Opus 5.5 f14d166fdf Issue #3272: AI masks are enlarged along the photo's edges, no outline under a raised Exposure
An Object / Describe mask is stored as a model's logit grid (288² over the whole photo,
~20 px cells on a 24 MP export) and was enlarged by bilinear sampling alone, so its edge
spilled 1–2 px onto the background; raising the mask's Exposure turned that strip into a
bright outline in previews and exports (CPU and GPU: the GPU renderer evaluates these
shapes with the same CPU `shape_alpha`).

`sample_seg` now guided-filters the sampled logits by the photo's log luminance where the
grid is coarser than the output: the fast (subsampled) guided filter, a window of 1.5 grid
cells, so a preview and an export put the edge in the same place. Filtering logits, not
coverage, lets the confident side win (the spill goes to ≈ 0, not to a mean of ≈ 0.1).
Pixels whose window is all inside or all outside, and edges the photo has no contrast
across, keep the plain sample exactly. Refine Edges still runs afterwards on the combined
mask and finds the edges in place: no second halo, no tightening.

One implementation: `guided_cross` (Refine Edges, Auto Mask) and the new
`guided_cross_fast` share `guided_coeffs`; the subsampled form uses
`local::guided_fast_step` and a box `resize`, like `local::guided_fast`. `guided_cross`'s
output is unchanged.

Existing AI masks become 1–2 px tighter at a subject's edges, on every process; their
inside, outside and contrast-less edges are unchanged. This lands in place under the
bug-fix rule of docs/process-versions.md (output that is in neither the photo nor the
edit), noted there.

Cost per AI selection (M2 Pro, 12 cores; one shape_alpha, before → after):
24 MP 25.7 → 48.2 ms, heap peak 96.5 → 108.8 MB; 60 MP 64.1 → 109.9 ms, 239.9 → 256.7 MB;
2.7 MP preview 3.1 → 10.6 ms, 11.2 → 26.5 MB.

Tests (a dark disc on a light background, its mask on a 32² grid): ≈ 0 one and two px
outside and ≈ 1 inside, all around (1 px outside was 0.66), bit-identical away from the
edge; with Refine Edges 50 / 100 (was 0.29 outside) and the edge within 1 px of the
unrefined one; the same edge position at 256, 512 and 1024 px; a Prompt mask's window
matches the whole render.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 11:13:04 +08:00
dotCooCoo fed2423f2c Merge commit 'refs/check/bf2856-main' into resume-2856
# Conflicts:
#	crates/ui-egui/src/menus/run.rs
2026-10-28 16:42:47 -07:00
helgehelge123 db406c021f Merge branch 'main' of https://github.com/storytold/lightcraft into space-hold-pan
# Conflicts:
#	crates/ui-egui/src/panels/detail.rs
#	crates/ui-egui/src/shortcuts.rs
2026-10-29 00:14:51 +01:00
tabasko78andClaude Opus 5.5 e4f8d74da6 FACES: a person's look-alikes are found on every core, with vector arithmetic
A person's page (and every face confirmed there) compares each unnamed
face with each of the person's named faces on the UI thread, on one core:
92 000 unnamed faces against 4 100 named ones is some 400 million
512-long dot products, about 2 min 40 s on an Apple M1 Pro with the
window frozen.

- matching::cosine sums in eight lanes, which the compiler vectorizes
  (about 4x faster on 512-long embeddings; same result to the last bits).
- matching::person_score: one person's score as rank gives it, with no
  names to group by and nothing allocated (same score, tested).
- similar() scores the candidates with rayon: about 3 s in the same case
  (benchmark at that scale: 163 s before, 3 s after).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:02:31 +01:00
dotCooCoo b5c36b53aa Merge main into feat/keyword-shortcut-keys
Follows main's split of menus.rs into menus/ and of the keyword tests into
keywords/tests.rs: Set Keyword Shortcut moves to menus/ui_commands.rs and
menus/run.rs, its catalog test to keywords/tests.rs, and the docs name the
moved test files.
2026-10-28 14:29:26 -07:00
Nathaniel Ledford 0311abdff6 LRC-LIB-FOLDERS: the relative-path test pins the absolute spelling; docs name the engine refusal 2026-10-28 17:07:51 -04:00
Nathaniel Ledford d39550486e LRC-LIB-FOLDERS: folder.rename and folder.move refuse the home folder and its standard places
The engine now refuses these two commands for the home folder and its Pictures, Desktop and
Downloads, whoever asks (the app, a script, an agent). The check is a pure function of the path
and the home folder; the commands read the real home once.
2026-10-28 17:07:51 -04:00
Nathaniel Ledford 8fca8eb4f5 LRC-LIB-FOLDERS: Local's built-in places offer no Rename or Move
The Home, Pictures, Desktop and Downloads rows carry a translated label. Rename Folder…
started its prompt with that label, so confirming it in German renamed ~/Pictures to
~/Bilder on disk, and Home was offered for rename at all. Local now lists no Rename Folder…
or Move Folder To… on a built-in place; a folder kept with Browse Folder… still renames
from its real name.
2026-10-28 17:07:51 -04:00
radialmonsterandClaude Opus 5.5 6188590675 Docs: link gap 8 and roadmap priority 7 to lens profile issue #329
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ti8KemZbjE2ZgHgV1q1BM
2026-10-28 13:58:49 -04:00
radialmonsterandClaude Sonnet 5.5 b881b20b72 Kelvin for Fujifilm X-Trans III bodies from the RAF's own neutral pair (#730)
X-T20, X-T2, X-Pro2, X-E3, X-H1 and X100F have no measured colour matrix, so
As Shot showed on the relative scale. Their RAFs store the camera's own
neutral multipliers for Illuminant A and D65 (tag 0xf00c). Two points
give a line in (ln R/G, ln B/G); mired is linear along it, isotherms are
perpendicular, tint is scaled by the CIE locus spacing. Only the file's pair
and CIE colorimetry are used. Bodies with matrices are unchanged. The look
stays the per-file JPEG fit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ti8KemZbjE2ZgHgV1q1BM
2026-10-28 13:50:56 -04:00
Nathaniel LedfordandClaude Opus 5.5 e2043f44df LRC-LIB-LIBFOLDERS: a count never covers a name in a narrow panel
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 11:44:38 -04:00
Nathaniel Ledford 17a9e97a38 LR-BEHAV-DIALOGS: a one-line prompt that's refused stays open and says why
A refused Rename Folder, New Folder on Disk or other name prompt closed without a word.
It now stays open with the typed text and toasts the engine's message. A New Folder on
Disk that works says where the folder is.
2026-10-28 11:42:23 -04:00
insideTheFlux 1b28224afd Merge storytold/main into fix/2575-geocode-dataset-params 2026-10-28 08:17:49 -07:00