Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
4564884
LR-LIB-VIRTUALCOPY: Share source reads across Reload and Recheck
radare Nov 19, 2026
b7fdf1c
LR-LIB-VIRTUALCOPY: keep Recheck metadata and Reload previews current
radare Nov 26, 2026
04b731d
Reload: skip the catalog membership scan for empty plans
radare Nov 26, 2026
a4d25c5
Reload and Recheck: refresh copies created while a probe runs
radare Nov 26, 2026
8c6e6ba
Reload: require file reads and record freshness after applying results
radare Nov 26, 2026
60c6185
Reload: report current file read failures in the app and command
radare Nov 26, 2026
ca2d86e
Reload: bind pending reads to their library opening
radare Nov 26, 2026
e1a5cd3
Reload: refresh browsed imports with their same-file copies
radare Nov 27, 2026
8998070
Keep the AI Defringe lens cache key while refreshing source facts
radare Nov 29, 2026
d7c593b
Keep earlier source reads valid after a partial rollback
radare Nov 29, 2026
3be9093
LR-IMP-FORMATS: Keep catalog source facts current on Reload and Relink
radare Nov 25, 2026
64539be
Relink: compare borrowed source lens facts
radare Nov 26, 2026
7aeebbe
Relink and source history: refresh camera facts and preserve valid ca…
radare Nov 26, 2026
9fb3b22
Relink: refresh lens names and expire stale source reads on history e…
radare Nov 26, 2026
e04e3af
Reload: retain the verified source white-balance scale and refresh fa…
radare Nov 26, 2026
dd0a09d
Library: retry queued edits before switching catalogs
radare Nov 26, 2026
0d7aef7
Refresh source lens, exposure and white balance consistently
radare Nov 26, 2026
85f3525
Reload: keep decoded sources after GPS-only edits
radare Nov 29, 2026
8d40ba3
LR-IMP-FORMATS: Keep verified DNG output facts and duplicate handling
radare Nov 25, 2026
4fea321
Test DNG restore across import batches and isolate test directories
radare Nov 26, 2026
f9c5de7
DNG Restore: verify path hits and preserve current source facts
radare Nov 26, 2026
d8bb842
Keep failed same-path replacements out of Restore
radare Nov 26, 2026
2f43eca
DNG conversion: preserve independently relinked virtual copies
radare Nov 26, 2026
faf141b
DNG Restore: verify output ownership and defer redundant copy cleanup
radare Nov 26, 2026
9548172
Restore verified legacy DNGs and preserve database lens corrections
radare Nov 26, 2026
adac54e
Validate same-path restores alongside content restores
radare Nov 26, 2026
9f1e06f
Verify converted DNG ownership and reconcile deleted source paths
radare Nov 26, 2026
c68db58
Separate import reconciliation from catalog commit
radare Nov 26, 2026
12491c4
Preserve browsed-photograph imports during DNG reconciliation
radare Nov 26, 2026
fe158eb
DNG Restore: reuse the worker’s file verification
radare Nov 28, 2026
0835d60
DNG import: verify the backup mirrors the converted output
radare Dec 3, 2026
bdad4a6
DNG import: cover valid replacements and redundant output cleanup
radare Dec 3, 2026
82306b6
DNG import: retain the backup copy result after verification
radare Dec 3, 2026
5d600d1
LR-CLOUD-SMARTPREVIEW: Preserve compatible proxy interpretations
radare Nov 25, 2026
042600d
Smart Previews: preserve live consumers and newer proxy files
radare Nov 26, 2026
8602ede
Report unreadable newer Smart Previews in background results
radare Nov 26, 2026
ba34c18
Format Smart Preview retention guard
radare Nov 26, 2026
33198d1
Smart Previews: report unreadable proxies and synchronize discard can…
radare Nov 26, 2026
1014bcd
Compile Smart Preview rebuild helpers only where used
radare Nov 26, 2026
61a5c57
Smart Previews: exercise lens provenance with compatible proxy jobs
radare Nov 27, 2026
b001614
Smart Previews: verify raw facts from the fresh original
radare Nov 27, 2026
a1333f3
Keep Smart Preview retention atomic with catalog changes
radare Dec 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/ATTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ covers a whole directory), or if a licence file referenced in the Licence column
| `crates/raw/src/chart_table.rs` | Chart-measured camera colour matrices (DNG ColorMatrix1/2 and ForwardMatrix1/2 for Standard Illuminant A and D50) for the Canon EOS D60 | LightCraft contributors; ColorChecker photographs taken by Robert Woldberg on the maintainer's EOS D60 | original work: fitted to our own CRWs of a ColorChecker Classic (post-November-2014 formulation) under a ~2,900 K tungsten bulb (11 frames) and direct sun (~4,850 K, 20 frames); reference colours: X-Rite's published L*a*b* (D50) for the chart, as packaged by [colour-science](https://github.com/colour-science/colour) (BSD-3-Clause), used for fitting only and not shipped; method in `clean-room/crw/10-chart-calibration.md` | MIT OR Apache-2.0 | 2026-10-25 | kept by hand: a 3×3 matrix per illuminant fitted on chromaticity with neutral held at D50; no Adobe or third-party camera matrix, no number from a GPL raw decoder |
| `assets/camera-tone/sony-dro-off.json` | Sony global tone curve with the Dynamic Range Optimizer off (32 knots), built into LightCraft for ARWs shot with DRO on | LightCraft contributors; source photographs by raw.pixls.us contributors | original work: tone curve quantile-matched over the pooled pixel pairs of 12 CC0 raw.pixls.us ARWs (DRO off, Standard creative style; ILCE-3500, -5000, -6600, -7CR, -7M3 ×3, -7S, -9M2, ILCA-77M2, SLT-A57, NEX-F3) and their embedded camera JPEGs; the file lists each source URL and SHA-256 and how the curve was derived (see also `docs/camera-preview-colour.md`); aggregate tone statistics only, no image content; no Adobe or third-party profile data | MIT OR Apache-2.0 (sources CC0) | 2026-10-09 | none |
| `crates/scenes/` (generated images) | Procedural demo photographs | LightCraft contributors | original work (generated at runtime, no source imagery) | MIT OR Apache-2.0 | 2026-09-30 | n/a |
| `crates/ui-egui/src/tests/recheck.rs`, `crates/engine/src/{files/tests.rs,tests/{recheck,import,smart_interpretation}.rs}` (runtime fixtures) | Generated source and Reload fixtures | LightCraft contributors | original work: procedural RGB pixels, linear DNGs generated by LightCraft (including a one-sample-bit mutation for mixed-content Restore), and a synthetic uncompressed ORF | MIT OR Apache-2.0 (`LICENSE-MIT`, `LICENSE-APACHE`) | 2026-11-25 | generated at runtime, no binary fixture committed |
| `crates/ui-egui/src/icons.rs` | UI icons drawn as vector paths in code | LightCraft contributors | original work | MIT OR Apache-2.0 | 2026-09-30 | n/a |
| `crates/ui-egui/src/panels/person.rs` | Up arrow on the People page bulk-confirm control, drawn in code | LightCraft contributors | original work | MIT OR Apache-2.0 | 2026-10-13 | n/a |
| `docs/images/*-tetons.jpg`, `docs/images/grid-pd.jpg` (screenshots containing it) | "The Tetons and the Snake River" | Ansel Adams (1942), U.S. National Archives | https://commons.wikimedia.org/wiki/File:Adams_The_Tetons_and_the_Snake_River.jpg | Public domain (U.S. federal government work) | 2026-09-30 | developed in LightCraft; shown inside app screenshots |
Expand Down
1 change: 1 addition & 0 deletions crates/catalog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ chrono = { workspace = true }
web-time = { workspace = true }

[target.'cfg(windows)'.dependencies]
lightcraft-wincolor = { workspace = true }
winapi-util = { workspace = true }

[dev-dependencies]
Expand Down
28 changes: 25 additions & 3 deletions crates/catalog/src/journal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
//! | 13 | Lens Blur | `DevelopSettings.lens_blur`, `Mask.adjust.lens_blur` |
//! | 14 | bursts arranged by hand in Assisted Culling | `Analysis.rank` |
//! | 15 | per-photo denoiser selection | `DevelopSettings.enhance.denoise_model` |
//! | 16 | probed source classification and white balance on Relink and Reload | `Op::Relink.kind`, `Op::SetSourceWb`, `Photo.source_relative_wb` |
//!
//! Rules:
//! - **Bump [`VERSION`]** (and add a row above) in the change that adds an [`Op`] variant or a
Expand Down Expand Up @@ -113,9 +114,10 @@ use crate::{Catalog, CatalogError, Op, Result};
pub const SNAPSHOT: &str = "catalog.snap";
pub const LOG: &str = "catalog.log";
const FORMAT: &str = "lightcraft-catalog";
const DENOISER_FORMAT_VERSION: u32 = 15;
/// The catalog format this build writes (and the newest it reads). See the module docs →
/// *Format versions*; bump it whenever an [`Op`] variant or a serialized field is added.
pub const VERSION: u32 = 15;
pub const VERSION: u32 = 16;

/// When [`Journal::wants_snapshot`] says it's time to compact the log.
#[derive(Clone, Copy, Debug)]
Expand Down Expand Up @@ -661,7 +663,7 @@ impl Journal {
// is appended: a snapshot in this format makes older builds refuse the library instead
// of misreading ops or dropping fields they don't know.
let older = (!report.created && snapshot_version != Some(VERSION)).then(|| snapshot_version.unwrap_or(0));
if older.is_some() {
if older.is_some_and(|version| version < DENOISER_FORMAT_VERSION) {
catalog.pin_legacy_denoise(resolve)?;
}
if let Some(at) = damaged_at {
Expand Down Expand Up @@ -896,17 +898,37 @@ impl Journal {
std::mem::take(&mut self.kept_written)
}

/// Older readers cannot replay these source facts, so the library needs a current snapshot.
pub fn needs_snapshot_for(&self, ops: &[Op]) -> bool {
if self.behind.is_none() {
return false;
}
let mut pending: Vec<_> = ops.iter().collect();
while let Some(op) = pending.pop() {
match op {
Op::Relink { kind: Some(_), .. } | Op::SetSourceWb { .. } => return true,
Op::AddPhoto { photo } if photo.source_relative_wb.is_some() => return true,
Op::Batch { ops } => pending.extend(ops),
_ => {}
}
}
false
}

/// Append ops (already applied to the live catalog) durably, in order.
pub fn append(&mut self, ops: &[Op]) -> Result<()> {
if ops.is_empty() {
return Ok(());
}
if self.needs_snapshot_for(ops) {
return Err(CatalogError::Io(format!("save a format v{VERSION} snapshot before journaling source facts")));
}
let t0 = web_time::Instant::now();
let mut buf = String::new();
let mut seq = self.seq;
for op in ops {
seq = seq.checked_add(1).ok_or_else(|| CatalogError::Corrupt(format!("{LOG}: op counter overflow")))?;
let line = if self.behind.is_some() && has_denoiser_pin(op) {
let line = if self.behind.is_some_and(|version| version < DENOISER_FORMAT_VERSION) && has_denoiser_pin(op) {
record(seq, serde_json::to_string(&ProtectedOp::PinnedDenoise { change: op }).unwrap_or_default())
} else {
encode_record(seq, op)
Expand Down
35 changes: 29 additions & 6 deletions crates/catalog/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,12 @@ pub enum Op {
id: PhotoId,
file_name: String,
source: Source,
/// The file's format when it changes too (Convert to DNG).
/// The file's format when it changes too (Convert to DNG or a fresh probe).
#[serde(default, skip_serializing_if = "Option::is_none")]
format: Option<String>,
/// A fresh probe's media kind; omitted by older journals and path-only moves.
#[serde(default, skip_serializing_if = "Option::is_none")]
kind: Option<MediaKind>,
},
/// What a photo's file is now (after it changed on disk: Reload).
SetContent {
Expand Down Expand Up @@ -250,6 +253,12 @@ pub enum Op {
id: PhotoId,
wb: Option<(f64, f64)>,
},
/// Source white balance verified from the file when its camera and catalog metadata disagree.
SetSourceWb {
id: PhotoId,
wb: Option<(f64, f64)>,
relative: Option<bool>,
},
/// The name shown for a colour label (`None` = its colour's name).
SetLabelName {
label: ColorLabel,
Expand Down Expand Up @@ -964,14 +973,18 @@ impl Catalog {
self.changes.now = Aspects::ALL;
self.touch(*id);
}
Op::SetDeleted { .. } | Op::SetLocal { .. } | Op::SetContent { .. } | Op::SetEmbeddedLens { .. } | Op::SetAsShotWb { .. } => {
self.changes.now = Aspects::ALL
}
Op::SetDeleted { .. }
| Op::SetLocal { .. }
| Op::SetContent { .. }
| Op::SetEmbeddedLens { .. }
| Op::SetAsShotWb { .. }
| Op::SetSourceWb { .. } => self.changes.now = Aspects::ALL,
Op::SetRating { .. } => self.changes.now = Aspects::RATING,
Op::SetFlag { .. } => self.changes.now = Aspects::FLAG,
Op::SetLabel { .. } => self.changes.now = Aspects::LABEL,
Op::SetMeta { .. } => self.changes.now = Aspects::META,
Op::SetCaptured { .. } => self.changes.now = Aspects::CAPTURED,
Op::Relink { kind: Some(_), .. } => self.changes.now = Aspects::ALL,
Op::SetFile { .. } | Op::Relink { .. } => self.changes.now = Aspects::FILE,
Op::SetAnalysis { .. } => self.changes.now = Aspects::ANALYSIS,
Op::SetDevelop { .. } | Op::SetVersions { .. } | Op::SetHistory { .. } | Op::PushHistory { .. } | Op::SetHistoryCursor { .. } => {
Expand Down Expand Up @@ -1231,14 +1244,16 @@ impl Catalog {
let p = self.photo_mut(id)?;
Op::SetCaptured { id, captured: std::mem::replace(&mut p.captured, captured) }
}
Op::Relink { id, file_name, source, format } => {
Op::Relink { id, file_name, source, format, kind } => {
if let Some(p) = self.photos.get(&id) {
self.index.file_changed(id, file_path(&p.source), file_path(&source));
}
let p = self.photo_mut(id)?;
let old_name = std::mem::replace(&mut p.file_name, file_name);
let old_format = format.map(|f| std::mem::replace(&mut p.format, f));
let old = Op::Relink { id, file_name: old_name, source: std::mem::replace(&mut p.source, source), format: old_format };
let old_kind = kind.map(|k| std::mem::replace(&mut p.kind, k));
let old =
Op::Relink { id, file_name: old_name, source: std::mem::replace(&mut p.source, source), format: old_format, kind: old_kind };
self.index.text_changed(id, self.photos.get(&id).map(|p| &**p));
old
}
Expand All @@ -1265,6 +1280,13 @@ impl Catalog {
let p = self.photo_mut(id)?;
Op::SetAsShotWb { id, wb: std::mem::replace(&mut p.as_shot_wb, wb) }
}
Op::SetSourceWb { id, wb, relative } => {
if wb.is_some_and(|(t, tint)| !(t.is_finite() && tint.is_finite())) {
return Err(CatalogError::Invalid("as-shot white balance is not a number".into()));
}
let p = self.photo_mut(id)?;
Op::SetSourceWb { id, wb: std::mem::replace(&mut p.as_shot_wb, wb), relative: std::mem::replace(&mut p.source_relative_wb, relative) }
}
Op::SetFile { id, file_name, source } => {
if file_name.trim().is_empty() {
return Err(CatalogError::Invalid("empty file name".into()));
Expand Down Expand Up @@ -1575,6 +1597,7 @@ fn changes_what_albums_test(op: &Op) -> bool {
| Op::SetContent { .. }
| Op::SetEmbeddedLens { .. }
| Op::SetAsShotWb { .. }
| Op::SetSourceWb { .. }
| Op::SetRating { .. }
| Op::SetFlag { .. }
| Op::SetLabel { .. }
Expand Down
3 changes: 2 additions & 1 deletion crates/catalog/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ impl Op {
| Op::Relink { id, .. }
| Op::SetContent { id, .. }
| Op::SetEmbeddedLens { id, .. }
| Op::SetAsShotWb { id, .. } => out(*id),
| Op::SetAsShotWb { id, .. }
| Op::SetSourceWb { id, .. } => out(*id),
Op::AddAlbum { album } => {
album.photos.iter().for_each(|p| out(*p));
album.cover.into_iter().for_each(&mut *out);
Expand Down
13 changes: 11 additions & 2 deletions crates/catalog/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@ pub struct Photo {
/// Raw files: the camera's as-shot white balance (Kelvin, tint).
#[serde(default)]
pub as_shot_wb: Option<(f64, f64)>,
/// The probed file's white-balance scale when it differs from the catalog's camera metadata.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub source_relative_wb: Option<bool>,
/// Hash of the file's bytes (hex), for duplicate detection and preview-cache keys.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub content_hash: Option<String>,
Expand Down Expand Up @@ -482,6 +485,11 @@ pub fn preview_stamp(preview_only: &Option<String>) -> String {
if preview_only.is_some() { APP_VERSION.to_string() } else { String::new() }
}

/// A fresh probe's stamp using the format it actually found, including supported ORFs.
pub fn preview_stamp_for(format: &str, preview_only: &Option<String>) -> String {
if format.eq_ignore_ascii_case("orf") { APP_VERSION.to_string() } else { preview_stamp(preview_only) }
}

impl Photo {
/// Keep the newest [`HISTORY_LIMIT`](crate::HISTORY_LIMIT) History steps; the cursor moves with
/// its step, or to the oldest step kept when its own is dropped. Returns how many were dropped.
Expand Down Expand Up @@ -525,6 +533,7 @@ impl Photo {
local: false,
duration: None,
as_shot_wb: None,
source_relative_wb: None,
content_hash: None,
embedded_lens: None,
copy_of: None,
Expand All @@ -544,7 +553,7 @@ impl Photo {
/// The stamp for a fresh probe. Supported ORFs keep it too, so the support-withdrawal
/// recheck runs once, without repeatedly probing uncompressed ORFs on every library open.
pub fn preview_stamp(&self, preview_only: &Option<String>) -> String {
if self.format.eq_ignore_ascii_case("orf") { APP_VERSION.to_string() } else { preview_stamp(preview_only) }
preview_stamp_for(&self.format, preview_only)
}
/// A preview-only photo or ORF whose support was checked by another app version (or before
/// stamps existed), so this build should probe its file again (issues #662 and #3775).
Expand All @@ -566,7 +575,7 @@ impl Photo {
/// [`Photo::fitted_look`] raw whose camera has no colour matrices measured either
/// ([`relative_wb_camera`]). Other raws edit white balance in Kelvin.
pub fn relative_wb(&self) -> bool {
self.develops_raw() && relative_wb_camera(&self.format, &self.meta.camera)
self.develops_raw() && self.source_relative_wb.unwrap_or_else(|| relative_wb_camera(&self.format, &self.meta.camera))
}
/// Every settings holder of this photo that can carry segmentation grids: the develop
/// settings, the versions', the history steps' and the import look. A snapshot's shared grid
Expand Down
Loading