From 366b1d218c2edee679ae03f5a8298aa06e73d4ce Mon Sep 17 00:00:00 2001 From: OneSlips Date: Mon, 12 Oct 2026 03:58:14 +1000 Subject: [PATCH 01/27] LR-PROF-IMPORT: import the user's own DNG camera profiles (.dcp) profile.import (File > Import Profiles & Presets, drag & drop) now also reads DNG Camera Profiles: the user's own .dcp files, e.g. made with a colour-checker tool. They appear in the profile browser and menu under Camera Profiles with dcp:- ids; profiles.camera lists them and profile.deleteCamera / profile.deleteImported remove them. A library on disk keeps a copy in Profiles/. No profile ships with the app and the repository holds none: tests build theirs in memory (write_dcp). lightcraft_raw::dcp parses the file per DNG spec ch. 6 (magic RC in place of 42; IFD 0 read through the existing DNG colour builders) and DcpProfile::applied_to puts its matrices, illuminants and look in place of a raw file's, keeping the shot's white balance, analog balance and baseline exposure. Choosing one (develop.profile) replaces the raw file's colour model when it is decoded, before the starting colour and the white-balance scale (WbScaleOf) are worked out, so the matrix path takes over from the fitted JPEG look (CR3/CR2/ARW...) and white balance follows the profile. A profile without a tone curve of its own (most chart-made ones) keeps the photo's contrast: the DNG's tone curve, else the tone of the camera-JPEG fit. The profile travels with SourceRef::File into FileLoader / PairLoader (new Option<&DcpProfile> argument); a decoded source records the profile it was made with and is not reused for another. Smart previews and the web render worker keep the file's own colour; rendered (non-raw) photos ignore it. This reverses the documented "Adobe profile formats deliberately unsupported" stance for user-supplied files only; docs updated. Split out of #1012. Co-Authored-By: Claude Opus 5.5 --- apps/lightcraft-web/src/store.rs | 6 +- crates/engine/src/cmd/dcp_profiles.rs | 175 +++++++++++ crates/engine/src/cmd/develop.rs | 5 +- crates/engine/src/cmd/lut_profiles.rs | 11 +- crates/engine/src/cmd/mod.rs | 2 + crates/engine/src/cmd/previews.rs | 14 +- crates/engine/src/files.rs | 54 +++- crates/engine/src/lib.rs | 5 + crates/engine/src/library.rs | 5 + crates/engine/src/media.rs | 76 ++++- crates/engine/src/presets.rs | 38 ++- crates/engine/src/smart.rs | 8 +- crates/engine/src/tests_dcp.rs | 141 +++++++++ crates/engine/src/tests_import.rs | 4 +- crates/raw/src/dcp.rs | 278 ++++++++++++++++++ crates/raw/src/lib.rs | 1 + .../ui-egui/examples/thumb_request_bench.rs | 2 +- crates/ui-egui/src/lib.rs | 2 +- crates/ui-egui/src/menus.rs | 13 +- crates/ui-egui/src/panels/edit.rs | 16 +- crates/ui-egui/src/panels/profiles.rs | 14 +- crates/ui-egui/src/pick.rs | 2 +- crates/ui-egui/src/render.rs | 4 +- docs/file-format-parity.md | 5 +- docs/parity-checklist.md | 11 +- docs/raw-parity.md | 5 +- docs/roadmap.md | 5 +- docs/xmp-interop.md | 19 +- 28 files changed, 838 insertions(+), 83 deletions(-) create mode 100644 crates/engine/src/cmd/dcp_profiles.rs create mode 100644 crates/engine/src/tests_dcp.rs create mode 100644 crates/raw/src/dcp.rs diff --git a/apps/lightcraft-web/src/store.rs b/apps/lightcraft-web/src/store.rs index 729e7940770..96750ba6d95 100644 --- a/apps/lightcraft-web/src/store.rs +++ b/apps/lightcraft-web/src/store.rs @@ -12,7 +12,7 @@ use std::collections::HashMap; use std::sync::{Arc, Mutex}; -use lightcraft_engine::files::{load_bytes, probe_bytes}; +use lightcraft_engine::files::{load_bytes_with, probe_bytes}; use lightcraft_engine::media::{FileLoader, FileProbe}; /// Prefix of the catalog paths of files kept in browser storage. @@ -144,9 +144,9 @@ impl Originals { /// Engine hooks that decode/probe from memory. pub fn hooks(&self) -> (FileLoader, FileProbe) { let s = self.clone(); - let loader: FileLoader = Arc::new(move |path: &str, max_edge: usize| { + let loader: FileLoader = Arc::new(move |path: &str, max_edge: usize, dcp: Option<&lightcraft_engine::media::DcpProfile>| { let bytes = s.get(path).ok_or_else(|| format!("{path}: the original is still loading from browser storage"))?; - load_bytes(&bytes, max_edge) + load_bytes_with(&bytes, max_edge, dcp) }); let s = self.clone(); let probe: FileProbe = Arc::new(move |path: &str| { diff --git a/crates/engine/src/cmd/dcp_profiles.rs b/crates/engine/src/cmd/dcp_profiles.rs new file mode 100644 index 00000000000..a6038480381 --- /dev/null +++ b/crates/engine/src/cmd/dcp_profiles.rs @@ -0,0 +1,175 @@ +//! Imported camera profiles: the user's own DNG Camera Profiles (`.dcp`), chosen like any other +//! profile (`develop.profile {id: "dcp:…"}`). Unlike the built-in looks and LUT profiles, which +//! work on developed colour, a camera profile replaces the raw file's colour model when it is +//! decoded (its matrices and hue/saturation map; see [`lightcraft_raw::dcp`]), so the photo's +//! source is decoded again when it changes. Other photos (JPEG, TIFF…) ignore it. +//! +//! A library on disk keeps a copy of each file in its `Profiles/` folder; the list lives in the +//! library's prefs and the profiles are parsed again when the library opens. + +use std::path::{Path, PathBuf}; +use std::sync::Arc; + +use lightcraft_raw::dcp::DcpProfile; +use serde_json::{Value, json}; + +use super::{CommandSpec, always, bad, cmd, str_param}; +use crate::{Result, Session}; + +/// Profile id prefix of imported camera profiles. +pub const DCP_PREFIX: &str = "dcp:"; +/// Profile browser group of imported camera profiles. +pub const DCP_GROUP: &str = "Camera Profiles"; + +/// One imported camera profile. +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct DcpEntry { + /// `dcp:`. + pub id: String, + /// `ProfileName`, else the file name. + pub name: String, + /// The camera it was made for (`UniqueCameraModel`). + #[serde(default)] + pub camera_model: String, + /// The `.dcp` file (the library's copy when there is a library on disk). + pub file: String, +} + +/// Is `id` an imported camera profile id? +pub fn is_dcp_id(id: &str) -> bool { + id.starts_with(DCP_PREFIX) +} + +fn profiles_dir(s: &Session) -> Option { + s.library.as_ref().filter(|l| l.on_disk).map(|l| l.dir.join("Profiles")) +} + +/// Parse every imported camera profile again and hand them to the decoder (missing or damaged +/// files are skipped: photos using them develop with the file's own colour). +pub fn register_all(s: &mut Session) { + let loaded: Vec<(String, Arc)> = s + .dcp_profiles + .iter() + .filter_map(|p| std::fs::read(&p.file).ok().and_then(|b| lightcraft_raw::dcp::parse_dcp(&b).ok()).map(|d| (p.id.clone(), Arc::new(d)))) + .collect(); + s.media.camera_profiles = loaded.into_iter().collect(); +} + +/// `.dcp` files under `paths` (folders searched). +pub fn dcp_files(paths: &[String]) -> Vec { + let is_dcp = |f: &Path| f.extension().is_some_and(|x| x.eq_ignore_ascii_case("dcp")); + let mut out = Vec::new(); + for p in paths { + let path = Path::new(p); + if path.is_dir() { + out.extend(crate::walk::files_in(path, None, crate::walk::Limits::default(), is_dcp).files); + } else if is_dcp(path) { + out.push(path.to_path_buf()); + } + } + out +} + +/// Import the `.dcp` files under `paths` → (imported `[{id, name, cameraModel}]`, failed `[[file, error]]`). +/// A profile already imported (same name, camera and bytes) is not added twice. +pub fn import_files(s: &mut Session, paths: &[String]) -> Result<(Vec, Vec)> { + const C: &str = "profile.import"; + let dir = profiles_dir(s); + if let Some(d) = &dir { + std::fs::create_dir_all(d).map_err(|e| bad(C, format!("{}: {e}", d.display())))?; + } + let (mut imported, mut failed) = (Vec::new(), Vec::new()); + for f in dcp_files(paths) { + let shown = f.display().to_string(); + let bytes = match std::fs::read(&f) { + Ok(b) => b, + Err(e) => { + failed.push(json!([shown, e.to_string()])); + continue; + } + }; + let profile = match lightcraft_raw::dcp::parse_dcp(&bytes) { + Ok(p) => p, + Err(e) => { + failed.push(json!([shown, e.to_string()])); + continue; + } + }; + let stem = f.file_stem().map(|n| n.to_string_lossy().to_string()).unwrap_or_else(|| "Camera Profile".into()); + let name = if profile.name.trim().is_empty() { stem.clone() } else { profile.name.trim().to_string() }; + // the same profile imported again: keep the one there is + let same = s + .dcp_profiles + .iter() + .find(|p| p.name == name && p.camera_model == profile.camera_model && std::fs::read(&p.file).is_ok_and(|b| b == bytes)); + if let Some(p) = same { + imported.push(json!({"id": p.id, "name": p.name, "cameraModel": p.camera_model, "existing": true})); + continue; + } + // (the file name keeps profiles with the same ProfileName apart, e.g. per-body copies) + let slug = crate::presets::slug(&format!("{}-{stem}", profile.camera_model)); + let mut id = format!("{DCP_PREFIX}{slug}"); + let mut n = 2; + while s.dcp_profiles.iter().any(|x| x.id == id) { + id = format!("{DCP_PREFIX}{slug}-{n}"); + n += 1; + } + let file = match &dir { + Some(d) => { + let to = d.join(format!("{}.dcp", id.trim_start_matches(DCP_PREFIX))); + std::fs::write(&to, &bytes).map_err(|e| bad(C, format!("{}: {e}", to.display())))?; + to.to_string_lossy().to_string() + } + // no library on disk: remember the original (the in-memory session ends with the app) + None => f.to_string_lossy().to_string(), + }; + s.media.camera_profiles.insert(id.clone(), Arc::new(profile.clone())); + s.dcp_profiles.push(DcpEntry { id: id.clone(), name: name.clone(), camera_model: profile.camera_model.clone(), file }); + imported.push(json!({"id": id, "name": name, "cameraModel": profile.camera_model})); + } + Ok((imported, failed)) +} + +fn delete(s: &mut Session, p: &Value) -> Result { + const C: &str = "profile.deleteCamera"; + let id = str_param(p, "id").ok_or_else(|| bad(C, "missing id"))?.to_string(); + let Some(i) = s.dcp_profiles.iter().position(|x| x.id == id) else { + return Err(bad(C, format!("no imported camera profile `{id}`"))); + }; + let entry = s.dcp_profiles.remove(i); + s.media.camera_profiles.remove(&id); + // the library's copy goes; a file outside the library is the user's and stays + if let Some(d) = profiles_dir(s) + && Path::new(&entry.file).starts_with(&d) + { + let _ = std::fs::remove_file(&entry.file); + } + s.profile_favorites.retain(|f| f != &id); + s.profile_recent.retain(|f| f != &id); + s.save_prefs()?; + Ok(json!({"deleted": id})) +} + +pub fn specs() -> Vec { + vec![ + cmd!( + query "profiles.camera", + "Imported Camera Profiles", + [], + None, + "{} → {profiles: [{id, name, cameraModel, file}]}: the imported .dcp camera profiles (use with develop.profile)", + always, + |s, _| Ok(json!({"profiles": s.dcp_profiles})) + ), + cmd!( + "profile.deleteCamera", + "Delete Imported Camera Profile", + [], + None, + "{id: dcp:…} — photos using it develop with their file's own colour again", + always, + delete + ), + ] +} diff --git a/crates/engine/src/cmd/develop.rs b/crates/engine/src/cmd/develop.rs index 42f59fe7274..14b11a23748 100644 --- a/crates/engine/src/cmd/develop.rs +++ b/crates/engine/src/cmd/develop.rs @@ -470,7 +470,10 @@ pub fn specs() -> Vec { }), cmd!("develop.profile", "Set Profile", [], None, "{id: profile id (see profiles.list), amount?: 0..200}", has_active, |s, p| { let id = str_param(p, "id").ok_or_else(|| bad("develop.profile", "missing id"))?.to_string(); - if !crate::presets::PROFILES.iter().any(|x| x.id == id) && !s.lut_profiles.iter().any(|x| x.id == id) { + if !crate::presets::PROFILES.iter().any(|x| x.id == id) + && !s.lut_profiles.iter().any(|x| x.id == id) + && !s.dcp_profiles.iter().any(|x| x.id == id) + { return Err(bad("develop.profile", format!("unknown profile `{id}`"))); } edit(s, "develop.profile", "Profile", |d| { diff --git a/crates/engine/src/cmd/lut_profiles.rs b/crates/engine/src/cmd/lut_profiles.rs index 349e66ea804..b9c6ecc902f 100644 --- a/crates/engine/src/cmd/lut_profiles.rs +++ b/crates/engine/src/cmd/lut_profiles.rs @@ -134,6 +134,10 @@ fn import(s: &mut Session, p: &Value) -> Result { s.lut_profiles.push(LutProfile { id: id.clone(), name: display.clone(), group: group.clone(), file }); imported.push(json!({"id": id, "name": display, "group": group})); } + // camera profiles (.dcp) among them + let (cameras, camera_failed) = super::dcp_profiles::import_files(s, &paths)?; + imported.extend(cameras); + failed.extend(camera_failed); s.save_prefs()?; Ok(json!({"imported": imported, "failed": failed})) } @@ -145,12 +149,15 @@ pub fn specs() -> Vec { "Import Profiles", [], None, - "{paths: [.cube file, folder or .zip]} — 3D LUTs become creative profiles (Amount 0–200 %; rendered on the CPU) in the profile browser's groups (folder / zip name, else Imported) → {imported: [{id, name, group}], failed}", + "{paths: [.cube / .dcp file, folder or .zip]} — 3D LUTs become creative profiles (Amount 0–200 %; rendered on the CPU) in the profile browser's groups (folder / zip name, else Imported); DNG camera profiles (.dcp, the user's own) become camera profiles (dcp: ids, group Camera Profiles) that replace a raw file's colour model when it is decoded → {imported: [{id, name, group | cameraModel}], failed}", always, import ), - cmd!("profile.deleteImported", "Delete Imported Profile", [], None, "{id: lut:…}", always, |s, p| { + cmd!("profile.deleteImported", "Delete Imported Profile", [], None, "{id: lut:… | dcp:…}", always, |s, p| { let id = str_param(p, "id").ok_or_else(|| bad("profile.deleteImported", "missing id"))?.to_string(); + if super::dcp_profiles::is_dcp_id(&id) { + return s.execute("profile.deleteCamera", p); + } let Some(i) = s.lut_profiles.iter().position(|x| x.id == id) else { return Err(bad("profile.deleteImported", format!("no imported profile `{id}`"))); }; diff --git a/crates/engine/src/cmd/mod.rs b/crates/engine/src/cmd/mod.rs index 4de460761fc..deb089acc3e 100644 --- a/crates/engine/src/cmd/mod.rs +++ b/crates/engine/src/cmd/mod.rs @@ -11,6 +11,7 @@ mod color; pub(crate) mod convert; mod cull; pub mod curves; +pub mod dcp_profiles; pub(crate) mod denoise; mod develop; mod edit; @@ -145,6 +146,7 @@ pub fn command_specs() -> &'static [CommandSpec] { v.extend(manage::specs()); v.extend(previews::specs()); v.extend(lut_profiles::specs()); + v.extend(dcp_profiles::specs()); v.extend(cull::specs()); v.extend(convert::specs()); v.extend(convert::edit_specs()); diff --git a/crates/engine/src/cmd/previews.rs b/crates/engine/src/cmd/previews.rs index 4fc7ababa65..d022fcb0608 100644 --- a/crates/engine/src/cmd/previews.rs +++ b/crates/engine/src/cmd/previews.rs @@ -212,7 +212,10 @@ struct SmartCounts { fn original_only(source: crate::media::SourceRef) -> Option { use crate::media::SourceRef; match source { - SourceRef::File { path, max_edge, loader, denoise, .. } => Some(SourceRef::File { path, max_edge, loader, fallback: None, denoise }), + // (a smart preview keeps the file's own colour: an imported camera profile is applied when the original is read) + SourceRef::File { path, max_edge, loader, denoise, .. } => { + Some(SourceRef::File { path, max_edge, loader, fallback: None, denoise, camera_profile: None }) + } SourceRef::Loaded(d) if d.info.is_some() => Some(SourceRef::Loaded(d)), _ => None, } @@ -548,7 +551,14 @@ mod tests { let mut jobs = jobs_for(&mut s, id, Some(512)); assert_eq!(jobs.len(), 2, "view and thumbnail"); assert!(jobs[0].view_cache.is_some(), "the view renders first"); - jobs[1].source = SourceRef::File { path: "/nonexistent/photo.arw".into(), max_edge: 512, loader: None, fallback: None, denoise: None }; + jobs[1].source = SourceRef::File { + path: "/nonexistent/photo.arw".into(), + max_edge: 512, + loader: None, + fallback: None, + denoise: None, + camera_profile: None, + }; assert!(run_photo(jobs), "the thumbnail rendered from the view's decoded source"); } diff --git a/crates/engine/src/files.rs b/crates/engine/src/files.rs index c48aaff77c2..455171fc7f4 100644 --- a/crates/engine/src/files.rs +++ b/crates/engine/src/files.rs @@ -11,6 +11,8 @@ use lightcraft_pipeline::SourceInfo; use lightcraft_raster::Rgb32f; use lightcraft_raster::resample::{Filter, fit}; +use lightcraft_raw::dcp::DcpProfile; + use crate::media::{DenoiseSpec, FileLoader, FileProbe, PairLoader, PreviewLoader, ProbeInfo}; fn meta_of(m: &lightcraft_meta::Metadata) -> (Meta, Option) { @@ -340,20 +342,30 @@ pub fn bin_factor(raw: &lightcraft_raw::RawImage, max_edge: usize) -> Option Result<(Rgb32f, SourceInfo), String> { - rayon::scope(|_| load_bytes_now(std::borrow::Cow::Borrowed(bytes), max_edge, None).map(|(img, _, info)| (img, info))) + rayon::scope(|_| load_bytes_now(std::borrow::Cow::Borrowed(bytes), max_edge, None, None).map(|(img, _, info)| (img, info))) +} + +/// [`load_bytes`] developing a raw file with an imported camera profile (`dcp`) in place of its own colour model. +pub fn load_bytes_with(bytes: &[u8], max_edge: usize, dcp: Option<&DcpProfile>) -> Result<(Rgb32f, SourceInfo), String> { + rayon::scope(|_| load_bytes_now(std::borrow::Cow::Borrowed(bytes), max_edge, None, dcp).map(|(img, _, info)| (img, info))) } /// [`load_bytes`] taking the file's bytes: a raw file's bytes are freed as soon as it is decoded /// (less memory held while it is developed). -pub fn load_vec(bytes: Vec, max_edge: usize) -> Result<(Rgb32f, SourceInfo), String> { - rayon::scope(move |_| load_bytes_now(std::borrow::Cow::Owned(bytes), max_edge, None).map(|(img, _, info)| (img, info))) +pub fn load_vec(bytes: Vec, max_edge: usize, dcp: Option<&DcpProfile>) -> Result<(Rgb32f, SourceInfo), String> { + rayon::scope(move |_| load_bytes_now(std::borrow::Cow::Owned(bytes), max_edge, None, dcp).map(|(img, _, info)| (img, info))) } /// [`load_vec`] that also develops the photo's cached denoised picture (`spec`) from the same decode: the plain /// picture, the denoised one (`None` when it cannot be read or does not fit this raw: the plain one is then all /// there is) and the source facts. Both pictures are the same size. -pub fn load_vec_pair(bytes: Vec, max_edge: usize, spec: &DenoiseSpec) -> Result<(Rgb32f, Option, SourceInfo), String> { - rayon::scope(move |_| load_bytes_now(std::borrow::Cow::Owned(bytes), max_edge, Some(spec))) +pub fn load_vec_pair( + bytes: Vec, + max_edge: usize, + spec: &DenoiseSpec, + dcp: Option<&DcpProfile>, +) -> Result<(Rgb32f, Option, SourceInfo), String> { + rayon::scope(move |_| load_bytes_now(std::borrow::Cow::Owned(bytes), max_edge, Some(spec), dcp)) } /// The denoised camera RGB of `raw` from its cached product, as the plain development would have it: the default @@ -382,6 +394,7 @@ fn load_bytes_now( bytes: std::borrow::Cow<'_, [u8]>, max_edge: usize, denoise: Option<&DenoiseSpec>, + dcp: Option<&DcpProfile>, ) -> Result<(Rgb32f, Option, SourceInfo), String> { if lightcraft_raw::probe(&bytes).is_some() { let mut raw = match lightcraft_raw::decode(&bytes).map_err(|e| preview_reason(&bytes, e)) { @@ -399,6 +412,24 @@ fn load_bytes_now( let info = raw.info(); let lens = crate::lens_profiles::for_raw(&info, || lightcraft_meta::extract(&bytes)); raw.opcodes.list3.retain(|op| !op.is_lens_correction()); + // A camera profile without a tone curve of its own (most chart-made ones: a matrix, maybe a hue/saturation map) + // keeps the contrast the photo has without it: the file's own DNG tone curve, else the tone of the look fitted + // to its camera JPEG. (A chart pins colour, not a rendering: its curve would be a choice, and this one is the + // camera's.) + let kept_tone = match dcp { + Some(p) if p.color.profile.tone_curve.is_none() => raw.color.profile.tone_curve.as_ref().and_then(dng_tone_curve).or_else(|| { + let own = raw.color.clone(); + let tone = crate::camera_preview::starting_colour(&mut raw, &bytes).2.map(|look| look.tone); + raw.color = own; + tone + }), + _ => None, + }; + // An imported camera profile replaces the file's colour model (its matrices and look; the shot's white stays), so + // the starting colour and the white balance scale below come from it, not from a fitted or built-in look. + if let Some(p) = dcp { + raw.color = p.applied_to(&raw.color); + } // Which scale white balance is edited on, and the as-shot white on it, from the file's own colour tags or // the camera's measured matrices (`Photo::relative_wb` decides the same from the catalog's camera) let scale = WbScaleOf::new(raw.format, &raw.color, raw.wb_multipliers, &raw.metadata); @@ -476,7 +507,8 @@ fn load_bytes_now( let tags = lightcraft_raw::ColorData { profile: Default::default(), ..raw.color.clone() }; Arc::new(lightcraft_pipeline::CameraColor { tags, developed_for: xy }) }); - let camera_tone = camera_look.as_ref().map(|p| p.tone).or_else(|| raw.color.profile.tone_curve.as_ref().and_then(dng_tone_curve)); + let camera_tone = + camera_look.as_ref().map(|p| p.tone).or_else(|| raw.color.profile.tone_curve.as_ref().and_then(dng_tone_curve)).or(kept_tone); let local_tone = local_tone(&raw); let (temp, tint) = scale.as_shot(xy); return Ok(( @@ -821,13 +853,13 @@ fn quick_image_srgb(header: &[u8], window: &[u8], max_edge: usize) -> Option PairLoader { - Arc::new(|path: &str, max_edge: usize, spec: &DenoiseSpec| { + Arc::new(|path: &str, max_edge: usize, spec: &DenoiseSpec, dcp: Option<&DcpProfile>| { let len = std::fs::metadata(path).map(|m| m.len() as usize).unwrap_or(0); let weight = len * if max_edge <= crate::media::SourceLevel::Thumb.max_edge() { 4 } else { 10 }; let gate = crate::memory::work_gate(); let _permit = if crate::memory::is_background() { gate.acquire(weight) } else { gate.acquire_urgent(weight) }; let bytes = std::fs::read(path).map_err(|e| format!("{path}: {e}"))?; - let r = load_vec_pair(bytes, max_edge, spec); + let r = load_vec_pair(bytes, max_edge, spec, dcp); crate::memory::release(); r }) @@ -841,13 +873,13 @@ pub fn fs_pair_loader() -> PairLoader { /// interactive loads (the loupe, exports) never wait — they are counted, so background work /// yields to them. pub fn fs_hooks() -> (FileLoader, FileProbe) { - let loader: FileLoader = Arc::new(|path: &str, max_edge: usize| { + let loader: FileLoader = Arc::new(|path: &str, max_edge: usize, dcp: Option<&DcpProfile>| { let len = std::fs::metadata(path).map(|m| usize::try_from(m.len()).unwrap_or(usize::MAX)).unwrap_or(0); let weight = len * if max_edge <= crate::media::SourceLevel::Thumb.max_edge() { 3 } else { 6 }; let gate = crate::memory::work_gate(); let _permit = if crate::memory::is_background() { gate.acquire(weight) } else { gate.acquire_urgent(weight) }; let bytes = std::fs::read(path).map_err(|e| format!("{path}: {e}"))?; - let r = load_vec(bytes, max_edge); + let r = load_vec(bytes, max_edge, dcp); // the file, the samples and the intermediate images are gone: give their pages back crate::memory::release(); r @@ -1068,7 +1100,7 @@ mod tests { product::write(&path, &camera_rgb, key).unwrap(); let spec = DenoiseSpec { product: path, key: key.into(), make: None }; let (ordinary, _) = load_bytes(&bytes, 2048).unwrap(); - let (plain, cached, _) = load_vec_pair(bytes, 2048, &spec).unwrap(); + let (plain, cached, _) = load_vec_pair(bytes, 2048, &spec, None).unwrap(); assert_eq!(plain.data, ordinary.data, "requesting a twin must not change the ordinary path"); let cached = cached.unwrap(); assert_eq!((plain.width, plain.height), (24, 32)); diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 3bc6c431ee0..0ddeafdcd80 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -257,6 +257,8 @@ pub struct Session { /// The user's point-curve presets (`curve.*`; built-ins: [`cmd::curves::builtin_presets`]), /// persisted in prefs.json. pub curve_presets: Vec, + /// Imported camera profiles (`.dcp`). + pub dcp_profiles: Vec, /// Saved colour-label name sets. pub label_sets: Vec, /// Look-alike signatures by content key (Find Similar). @@ -373,6 +375,7 @@ impl Session { metadata_presets: Vec::new(), filter_presets: Vec::new(), curve_presets: Vec::new(), + dcp_profiles: Vec::new(), label_sets: Vec::new(), signatures: Default::default(), lut_profiles: Vec::new(), @@ -984,6 +987,8 @@ mod tests_color; #[cfg(test)] mod tests_crop_angle; #[cfg(test)] +mod tests_dcp; +#[cfg(test)] mod tests_denoise; #[cfg(test)] mod tests_export; diff --git a/crates/engine/src/library.rs b/crates/engine/src/library.rs index 2bb5511c2dd..51523b4e61b 100644 --- a/crates/engine/src/library.rs +++ b/crates/engine/src/library.rs @@ -171,6 +171,8 @@ struct PrefsFile { label_sets: Vec, /// Imported LUT profiles. lut_profiles: Vec, + /// Imported camera profiles (`.dcp`). + dcp_profiles: Vec, /// Keyword sets, the one in use, recent keywords. keyword_sets: Vec, keyword_set: Option, @@ -399,6 +401,8 @@ impl Session { self.label_sets = prefs.label_sets; self.lut_profiles = prefs.lut_profiles; crate::cmd::lut_profiles::register_all(self); + self.dcp_profiles = prefs.dcp_profiles; + crate::cmd::dcp_profiles::register_all(self); self.keyword_sets = prefs.keyword_sets; self.keyword_set = prefs.keyword_set; self.recent_keywords = prefs.recent_keywords; @@ -633,6 +637,7 @@ impl Session { curve_presets: self.curve_presets.clone(), label_sets: self.label_sets.clone(), lut_profiles: self.lut_profiles.clone(), + dcp_profiles: self.dcp_profiles.clone(), keyword_sets: self.keyword_sets.clone(), keyword_set: self.keyword_set.clone(), recent_keywords: self.recent_keywords.clone(), diff --git a/crates/engine/src/media.rs b/crates/engine/src/media.rs index 6f6f0359c45..c62a62232f8 100644 --- a/crates/engine/src/media.rs +++ b/crates/engine/src/media.rs @@ -24,6 +24,7 @@ use lightcraft_develop::DevelopSettings; use lightcraft_pipeline::{Quality, RenderRequest, Rendered, SourceInfo, StageCache}; use lightcraft_preview::{Hash128, Hasher128, Lru, PreviewCache}; use lightcraft_raster::{Histogram, Rgb32f, Rgba8}; +pub use lightcraft_raw::dcp::DcpProfile; use serde::{Deserialize, Serialize}; const SETTINGS_HASH_ENTRIES: usize = 1024; @@ -119,7 +120,9 @@ fn source_edge_needed(p: &Photo, settings: &DevelopSettings, apply_crop: bool, o } /// Decodes a file into a linear Rec.2020 image no larger than `max_edge` (set by the app). -pub type FileLoader = Arc Result<(Rgb32f, SourceInfo), String> + Send + Sync>; +/// The third argument is the photo's imported camera profile ([`crate::cmd::dcp_profiles`]): a raw file is developed +/// with its colour model. +pub type FileLoader = Arc) -> Result<(Rgb32f, SourceInfo), String> + Send + Sync>; /// A raw file's embedded (camera-rendered) preview as display sRGB, oriented, no larger than /// `max_edge` (set by the app). `None`: no usable preview. @@ -142,7 +145,8 @@ pub struct DenoiseSpec { /// Decodes a raw file once and develops it twice: as usual, and from the denoised picture in `spec` when that can be /// read (`None` when it cannot). Both are at most `max_edge` long and the same size. -pub type PairLoader = Arc Result<(Rgb32f, Option, SourceInfo), String> + Send + Sync>; +pub type PairLoader = + Arc) -> Result<(Rgb32f, Option, SourceInfo), String> + Send + Sync>; /// A photo's denoised picture next to its plain one, and the last mix of the two that was asked for. pub struct Twin { @@ -172,11 +176,14 @@ pub struct DecodedSource { pub camera_tone: Option, /// The same picture developed from the AI-denoised mosaic, when the photo has one cached. pub denoised: Option>, + /// The imported camera profile (`dcp:…` id) the raw file was developed with, if any: a cached source made with + /// another one (or none) doesn't stand in for it. + pub camera_profile: Option, } impl DecodedSource { pub fn new(image: Arc, info: Option) -> Self { - DecodedSource { image, info, camera_tone: None, denoised: None } + DecodedSource { image, info, camera_tone: None, denoised: None, camera_profile: None } } /// The picture to develop for a Denoise `amount` (0 to 1, see [`DevelopSettings::denoise_amount`]): the plain one, @@ -236,6 +243,8 @@ pub enum SourceRef { fallback: Option, /// The photo has a cached denoised picture: load it with the plain one (see [`PairLoader`]). denoise: Option<(DenoiseSpec, PairLoader)>, + /// The photo's imported camera profile (id and profile): its raw file is developed with it. + camera_profile: Option<(String, Arc)>, }, /// A smart preview standing in for a missing original. Smart { @@ -252,9 +261,12 @@ impl SourceRef { let image = match self { SourceRef::Loaded(a) => return Ok((**a).clone()), SourceRef::Demo { scene, max_edge } => crate::demo::scene_pixels(scene, *max_edge)?, - SourceRef::File { path, max_edge, loader, fallback, denoise } => { + SourceRef::File { path, max_edge, loader, fallback, denoise, camera_profile } => { + let dcp = camera_profile.as_ref().map(|(_, p)| p.as_ref()); + let made_with = camera_profile.as_ref().map(|(id, _)| id.clone()); let plain = || match loader { - Some(l) => l(path, *max_edge).map(|(image, info)| DecodedSource::new(Arc::new(image), Some(info))), + Some(l) => l(path, *max_edge, dcp) + .map(|(image, info)| DecodedSource { camera_profile: made_with.clone(), ..DecodedSource::new(Arc::new(image), Some(info)) }), None => Err(format!("no decoder available for {path}")), }; // the denoised picture comes with the plain one from a single decode; when it cannot be read the @@ -268,7 +280,7 @@ impl SourceRef { None => true, }; if made { - pair(path, *max_edge, spec).and_then(|(image, twin, info)| { + pair(path, *max_edge, spec, dcp).and_then(|(image, twin, info)| { if spec.make.is_some() && twin.is_none() { return Err("the cached AI Denoise picture could not be read; clear the denoise cache and retry".into()); } @@ -277,6 +289,7 @@ impl SourceRef { info: Some(info), camera_tone: None, denoised: twin.map(|t| Arc::new(Twin::new(Arc::new(t)))), + camera_profile: made_with.clone(), }) }) } else { @@ -334,6 +347,8 @@ pub struct MediaCache { pub rendered: Arc, /// Which photos have a cached denoised picture, and how to read it. pub denoise: DenoiseIndex, + /// Imported camera profiles by id ([`crate::cmd::dcp_profiles`]), handed to the decoder of photos using them. + pub camera_profiles: std::collections::HashMap>, } /// The photos that have a cached denoised picture for the denoise model in use. Only memory: nothing here touches the @@ -402,6 +417,7 @@ impl Default for MediaCache { scenes: Vec::new(), rendered: Arc::new(PreviewCache::memory(rendered_budget(budget))), denoise: DenoiseIndex::default(), + camera_profiles: HashMap::new(), } } } @@ -622,7 +638,12 @@ impl MediaCache { } fn source_ref_plain(&mut self, p: &Photo, level: SourceLevel, cached: bool) -> SourceRef { - if cached && let Some(a) = self.get_source(p.id, level) { + let wanted = self.camera_profile_of(p); + // (a source developed with another camera profile, or none, doesn't stand in) + if cached + && let Some(a) = self.get_source(p.id, level) + && a.camera_profile == wanted.as_ref().map(|(id, _)| id.clone()) + { return SourceRef::Loaded(Box::new(a)); } // Procedural scenes have a nominal size: "full" is that size, not unbounded. @@ -644,12 +665,26 @@ impl MediaCache { return SourceRef::Smart { path: sp }; } let mut r = self.origin_ref(&p.source, max_edge); - if let SourceRef::File { fallback, .. } = &mut r { + if let SourceRef::File { fallback, camera_profile, .. } = &mut r { *fallback = Some(sp); + *camera_profile = wanted; } return r; } - self.origin_ref(&p.source, max_edge) + let mut r = self.origin_ref(&p.source, max_edge); + if let SourceRef::File { camera_profile, .. } = &mut r { + *camera_profile = wanted; + } + r + } + + /// The imported camera profile photo `p` develops with: its profile setting names one this library has. + pub fn camera_profile_of(&self, p: &Photo) -> Option<(String, Arc)> { + let id = &p.develop.profile.id; + if !crate::cmd::dcp_profiles::is_dcp_id(id) { + return None; + } + self.camera_profiles.get(id).map(|d| (id.clone(), d.clone())) } /// How to load `origin` at most `max_edge` pixels long, ignoring decoded sources in memory (a @@ -662,12 +697,19 @@ impl MediaCache { } match self.scenes.iter().find(|s| s.id == *scene) { Some(s) => SourceRef::Demo { scene: Box::new(s.clone()), max_edge }, - None => SourceRef::File { path: format!("demo:{scene}"), max_edge, loader: None, fallback: None, denoise: None }, + None => { + SourceRef::File { path: format!("demo:{scene}"), max_edge, loader: None, fallback: None, denoise: None, camera_profile: None } + } } } - Source::File { path } => { - SourceRef::File { path: path.clone(), max_edge, loader: self.file_loader.clone(), fallback: None, denoise: None } - } + Source::File { path } => SourceRef::File { + path: path.clone(), + max_edge, + loader: self.file_loader.clone(), + fallback: None, + denoise: None, + camera_profile: None, + }, } } } @@ -1571,7 +1613,7 @@ mod thumbnail_hash_tests { #[test] fn source_from_before_content_reload_is_not_accepted() { let mut s = session(); - s.media.file_loader = Some(Arc::new(|_, _| Ok((Rgb32f::new(8, 8), SourceInfo::default())))); + s.media.file_loader = Some(Arc::new(|_, _, _| Ok((Rgb32f::new(8, 8), SourceInfo::default())))); let old = s.thumb_job(PhotoId(1), 256).unwrap().run(); assert!(old.loaded.is_some()); s.catalog @@ -1640,13 +1682,14 @@ mod tests { job.source = SourceRef::File { path: "synthetic.arw".into(), max_edge: 64, - loader: Some(Arc::new(move |_, _| { + loader: Some(Arc::new(move |_, _, _| { let mut image = Rgb32f::new(64, 64); image.data.fill([0.1; 3]); Ok((image, loaded_info.clone())) })), fallback: None, denoise: None, + camera_profile: None, }; job.info = SourceInfo::default(); // Header facts cannot override decoder facts. job.settings = Arc::new(DevelopSettings::default()); @@ -1699,9 +1742,10 @@ mod tests { job.source = SourceRef::File { path: "/photos/DSC00001.ARW".into(), max_edge: 64, - loader: Some(Arc::new(move |_, _| Ok((loaded_pixels.clone(), loaded_info.clone())))), + loader: Some(Arc::new(move |_, _, _| Ok((loaded_pixels.clone(), loaded_info.clone())))), fallback: None, denoise: None, + camera_profile: None, }; let undo_before = s.undo.len(); let request = job.request; diff --git a/crates/engine/src/presets.rs b/crates/engine/src/presets.rs index 8c36aa74290..92b04dd03dd 100644 --- a/crates/engine/src/presets.rs +++ b/crates/engine/src/presets.rs @@ -445,7 +445,17 @@ impl Session { if let Some(p) = profile(id) { return Some((p.name, p.group)); } - self.lut_profiles.iter().find(|p| p.id == id).map(|p| (p.name.as_str(), p.group.as_str())) + if let Some(p) = self.lut_profiles.iter().find(|p| p.id == id) { + return Some((p.name.as_str(), p.group.as_str())); + } + self.dcp_profiles.iter().find(|p| p.id == id).map(|p| (p.name.as_str(), crate::cmd::dcp_profiles::DCP_GROUP)) + } + + /// The imported profiles as (id, name, group): LUT profiles, then camera profiles (`.dcp`). + pub fn imported_profiles(&self) -> Vec<(String, String, String)> { + let luts = self.lut_profiles.iter().map(|p| (p.id.clone(), p.name.clone(), p.group.clone())); + let dcps = self.dcp_profiles.iter().map(|p| (p.id.clone(), p.name.clone(), crate::cmd::dcp_profiles::DCP_GROUP.to_string())); + luts.chain(dcps).collect() } /// Remember `id` as the most recently applied profile. @@ -459,28 +469,30 @@ impl Session { pub fn profile_menu(&self) -> Value { let item = |p: &ProfileInfo| json!({"id": p.id, "name": p.name, "group": p.group, "favorite": self.profile_favorites.iter().any(|f| f == p.id)}); - let lut_item = |id: &str| { - self.lut_profiles - .iter() - .find(|p| p.id == id) - .map(|p| json!({"id": p.id, "name": p.name, "group": p.group, "favorite": self.profile_favorites.contains(&p.id), "imported": true})) + let imported = self.imported_profiles(); + let imported_item = |(id, name, group): &(String, String, String)| { + let mut v = json!({"id": id, "name": name, "group": group, "favorite": self.profile_favorites.contains(id), "imported": true}); + if let Some(d) = self.dcp_profiles.iter().find(|d| &d.id == id) { + v["cameraModel"] = json!(d.camera_model); + } + v }; + let lut_item = |id: &str| imported.iter().find(|p| p.0 == id).map(imported_item); let list = |ids: &[String]| ids.iter().filter_map(|id| profile(id).map(item).or_else(|| lut_item(id))).collect::>(); let mut groups: Vec = profile_groups() .into_iter() .map(|g| json!({"name": g, "profiles": PROFILES.iter().filter(|p| p.group == g).map(item).collect::>()})) .collect(); - // imported LUT profiles, by their groups + // imported LUT profiles by their groups, then camera profiles let mut lut_groups: Vec<&str> = self.lut_profiles.iter().map(|p| p.group.as_str()).collect(); lut_groups.sort_unstable(); lut_groups.dedup(); + if !self.dcp_profiles.is_empty() { + lut_groups.push(crate::cmd::dcp_profiles::DCP_GROUP); + } + lut_groups.dedup(); for g in lut_groups { - let profiles: Vec = self - .lut_profiles - .iter() - .filter(|p| p.group == g) - .map(|p| json!({"id": p.id, "name": p.name, "group": p.group, "favorite": self.profile_favorites.contains(&p.id), "imported": true})) - .collect(); + let profiles: Vec = imported.iter().filter(|p| p.2 == g).map(imported_item).collect(); groups.push(json!({"name": g, "profiles": profiles, "imported": true})); } json!({ diff --git a/crates/engine/src/smart.rs b/crates/engine/src/smart.rs index 3628f188cef..3cadded593f 100644 --- a/crates/engine/src/smart.rs +++ b/crates/engine/src/smart.rs @@ -312,7 +312,13 @@ pub fn mark_look_checked(dir: &Path) -> Result<(), String> { /// Load the proxy at `path`. pub fn load(path: &Path) -> Result { let b = std::fs::read(path).map_err(|e| format!("{}: {e}", path.display()))?; - decode(&b).map(|(image, camera_tone)| crate::media::DecodedSource { image: Arc::new(image), info: None, camera_tone, denoised: None }) + decode(&b).map(|(image, camera_tone)| crate::media::DecodedSource { + image: Arc::new(image), + info: None, + camera_tone, + denoised: None, + camera_profile: None, + }) } #[cfg(test)] diff --git a/crates/engine/src/tests_dcp.rs b/crates/engine/src/tests_dcp.rs new file mode 100644 index 00000000000..aa3c791681d --- /dev/null +++ b/crates/engine/src/tests_dcp.rs @@ -0,0 +1,141 @@ +//! Imported camera profiles (`.dcp`): import, choosing one for a raw photo, decoding with it, the +//! source cache, persistence and deletion. Profiles are built in memory (no profile file is committed). + +use std::path::PathBuf; + +use lightcraft_catalog::PhotoId; +use lightcraft_raw::dcp::{DcpProfile, write_dcp}; +use lightcraft_raw::{ColorData, Mat3}; +use serde_json::json; + +use crate::Session; +use crate::media::SourceRef; + +fn temp_dir(tag: &str) -> PathBuf { + let d = std::env::temp_dir().join(format!("lc-dcp-{tag}-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&d); + std::fs::create_dir_all(&d).unwrap(); + d +} + +/// A profile whose matrix swaps the camera's red and blue (our own numbers): photos developed with it +/// come out with red and blue exchanged, which is easy to see in a test. +fn swapping_profile(name: &str) -> DcpProfile { + let m = Mat3([[0.0, 0.0, 1.0], [0.0, 1.0, 0.0], [1.0, 0.0, 0.0]]); + let xyz_to_cam = m.mul(&Mat3([[3.2406, -1.5372, -0.4986], [-0.9689, 1.8758, 0.0415], [0.0557, -0.2040, 1.0570]])); + DcpProfile { + name: name.into(), + camera_model: "LightCraft Test Camera".into(), + color: ColorData { illuminant: [21, 0], color_matrix: [Some(xyz_to_cam), None], ..Default::default() }, + } +} + +fn mean_rgb(img: &lightcraft_raster::Rgb32f) -> [f32; 3] { + let n = img.data.len().max(1) as f32; + let s = img.data.iter().fold([0.0f32; 3], |a, p| [a[0] + p[0], a[1] + p[1], a[2] + p[2]]); + [s[0] / n, s[1] / n, s[2] / n] +} + +#[test] +fn a_camera_profile_replaces_the_raw_colour_model_when_decoding() { + let dng = crate::tests_xmp::synthetic_dng_with(None, Default::default()); + let (plain, plain_info) = crate::files::load_bytes(&dng, 64).unwrap(); + let p = swapping_profile("Swap"); + let (with, info) = crate::files::load_bytes_with(&dng, 64, Some(&p)).unwrap(); + let (a, b) = (mean_rgb(&plain), mean_rgb(&with)); + assert!((a[0] - b[0]).abs() > 1e-3 || (a[2] - b[2]).abs() > 1e-3, "the profile changes the colour: {a:?} vs {b:?}"); + // white balance at render time works from the profile's matrices + let tags = &info.camera_color.as_ref().expect("a matrix colour model").tags; + assert_eq!(tags.color_matrix, p.color.color_matrix); + assert_ne!(plain_info.camera_color.as_ref().map(|c| c.tags.color_matrix), Some(p.color.color_matrix)); +} + +#[test] +fn a_profile_without_a_tone_curve_keeps_the_photos_contrast() { + use lightcraft_raw::profile::ToneCurve; + // a DNG with a tone curve of its own (our numbers: 18 % grey → 30 %) + let plain = crate::tests_xmp::synthetic_dng_with(None, Default::default()); + let mut raw = lightcraft_raw::decode(&plain).unwrap(); + raw.color.profile.tone_curve = ToneCurve::from_tag(&[0.0, 0.0, 0.18, 0.3, 1.0, 1.0]); + let dng = lightcraft_raw::write_dng(&raw, &Default::default()).unwrap(); + // a chart-style profile (no curve) keeps the file's curve + let (_, info) = crate::files::load_bytes_with(&dng, 64, Some(&swapping_profile("Swap"))).unwrap(); + let tone = info.camera_tone.expect("the file's tone curve stays"); + assert!((tone.apply(0.18) - 0.3).abs() < 0.01, "{}", tone.apply(0.18)); + // a profile with a curve of its own uses that one (18 % → 45 %) + let mut curved = swapping_profile("Curved"); + curved.color.profile.tone_curve = ToneCurve::from_tag(&[0.0, 0.0, 0.18, 0.45, 1.0, 1.0]); + let (_, info) = crate::files::load_bytes_with(&dng, 64, Some(&curved)).unwrap(); + let tone = info.camera_tone.expect("the profile's tone curve"); + assert!((tone.apply(0.18) - 0.45).abs() < 0.01, "{}", tone.apply(0.18)); +} + +#[test] +fn import_choose_cache_persist_and_delete() { + let dir = temp_dir("session"); + let (lib, files) = (dir.join("lib"), dir.join("files")); + std::fs::create_dir_all(files.join("profiles")).unwrap(); + let raw = files.join("IMG_0001.dng"); + std::fs::write(&raw, crate::tests_xmp::synthetic_dng_with(None, Default::default())).unwrap(); + std::fs::write(files.join("profiles").join("Swap.dcp"), write_dcp(&swapping_profile("Swap")).unwrap()).unwrap(); + std::fs::write(files.join("profiles").join("Broken.dcp"), b"IIRC\x08\0\0\0junk").unwrap(); + let id; + let dcp_id; + { + let mut s = Session::new().with_fs(); + s.open_library(&lib, false).unwrap(); + let r = s.execute("library.import", &json!({"paths": [raw.to_string_lossy()]})).unwrap(); + id = PhotoId(r["imported"][0].as_u64().unwrap()); + s.execute("library.select", &json!({"ids": [id.0]})).unwrap(); + // a folder: the good profile comes in, the broken one is reported + let r = s.execute("profile.import", &json!({"paths": [files.join("profiles").to_string_lossy()]})).unwrap(); + assert_eq!(r["imported"].as_array().unwrap().len(), 1, "{r}"); + assert_eq!(r["failed"].as_array().unwrap().len(), 1, "{r}"); + dcp_id = r["imported"][0]["id"].as_str().unwrap().to_string(); + assert!(dcp_id.starts_with("dcp:")); + assert_eq!(r["imported"][0]["cameraModel"], "LightCraft Test Camera"); + // importing it again adds nothing + let again = s.execute("profile.import", &json!({"paths": [files.join("profiles").join("Swap.dcp").to_string_lossy()]})).unwrap(); + assert_eq!(again["imported"][0]["existing"], true); + assert_eq!(s.dcp_profiles.len(), 1); + // the library keeps its own copy + assert!(std::path::Path::new(&s.dcp_profiles[0].file).starts_with(&lib)); + // listed in the profile menu under Camera Profiles + let menu = s.profile_menu(); + let group = menu["groups"].as_array().unwrap().iter().find(|g| g["name"] == "Camera Profiles").expect("a Camera Profiles group"); + assert_eq!(group["profiles"][0]["id"], dcp_id.as_str()); + // develop the photo with it: a decode made without it doesn't stand in + let before = s.render_job(id, 48, 48, false, true).unwrap().run(); + let loaded = before.loaded.clone().expect("decoded from the file"); + assert!(loaded.camera_profile.is_none()); + s.media.insert(id, before.level, loaded.image.clone()); + assert!(matches!(s.render_job(id, 48, 48, false, true).unwrap().source, SourceRef::Loaded(_)), "cached while nothing changed"); + s.execute("develop.profile", &json!({"id": dcp_id})).unwrap(); + let job = s.render_job(id, 48, 48, false, true).unwrap(); + match &job.source { + SourceRef::File { camera_profile: Some((pid, _)), .. } => assert_eq!(pid, &dcp_id), + _ => panic!("the photo is decoded again with its camera profile"), + } + let after = job.run(); + assert_eq!(after.loaded.as_ref().and_then(|l| l.camera_profile.clone()).as_deref(), Some(dcp_id.as_str())); + assert!(after.rendered.is_ok()); + assert_ne!(mean_rgb(&before.loaded.unwrap().image), mean_rgb(&after.loaded.unwrap().image)); + s.persist().unwrap(); + s.close_library().unwrap(); + } + // reopened: the profile is there and decodes again + let mut s = Session::new().with_fs(); + s.open_library(&lib, false).unwrap(); + assert_eq!(s.dcp_profiles.len(), 1); + assert!(s.media.camera_profiles.contains_key(&dcp_id)); + assert_eq!(s.catalog.photo(id).unwrap().develop.profile.id, dcp_id); + assert_eq!(s.profile_info(&dcp_id).map(|(_, g)| g), Some("Camera Profiles")); + // deleted: photos using it develop with their file's own colour, the library's copy goes + let file = s.dcp_profiles[0].file.clone(); + s.execute("profile.deleteImported", &json!({"id": dcp_id})).unwrap(); + assert!(s.dcp_profiles.is_empty() && !std::path::Path::new(&file).exists()); + let p = s.catalog.photo(id).unwrap().clone(); + assert!(s.media.camera_profile_of(&p).is_none()); + assert!(s.execute("develop.profile", &json!({"id": dcp_id})).is_err(), "no longer a known profile"); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/engine/src/tests_import.rs b/crates/engine/src/tests_import.rs index 185993494a1..d8e6b4df15a 100644 --- a/crates/engine/src/tests_import.rs +++ b/crates/engine/src/tests_import.rs @@ -1280,9 +1280,9 @@ fn look_loader( tone: lightcraft_pipeline::tone::CameraTone, calls: std::sync::Arc, ) -> crate::media::FileLoader { - std::sync::Arc::new(move |path, max_edge| { + std::sync::Arc::new(move |path, max_edge, dcp| { calls.fetch_add(1, std::sync::atomic::Ordering::SeqCst); - let (img, mut info) = plain(path, max_edge)?; + let (img, mut info) = plain(path, max_edge, dcp)?; info.camera_tone = Some(tone); Ok((img, info)) }) diff --git a/crates/raw/src/dcp.rs b/crates/raw/src/dcp.rs new file mode 100644 index 00000000000..0f2aa95fe94 --- /dev/null +++ b/crates/raw/src/dcp.rs @@ -0,0 +1,278 @@ +//! DNG Camera Profiles (`.dcp`): the user's own camera colour profiles, read at run time from +//! files they supply (DNG specification, chapter 6 "Camera Profiles"). A `.dcp` is a TIFF-structured +//! file whose header carries the magic `RC` (0x4352) in place of 42, with the profile tags in IFD 0: +//! `UniqueCameraModel`, `ProfileName`, the colour/forward matrices and calibration illuminants, the +//! hue/saturation map, look table and tone curve. Nothing here ships a profile. + +use lightcraft_tiff::{Ifd, ParseOptions, Tiff, tags as t}; + +use crate::ColorData; +use crate::dng::color_data; + +/// The magic number of a DNG camera profile file (`IIRC` / `MMCR`). +pub const DCP_MAGIC: u16 = 0x4352; + +/// A parsed camera profile. +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct DcpProfile { + /// `ProfileName` (empty when the file has none). + pub name: String, + /// `UniqueCameraModel`: the camera the profile was made for (empty when absent). + pub camera_model: String, + /// The colour model: illuminants, matrices and the profile look (hue/sat map, look table, tone curve). + pub color: ColorData, +} + +impl DcpProfile { + /// `color` (a raw file's own colour facts) with this profile's colour model in place of the + /// file's: its matrices, illuminants and look. The file's white balance (as-shot neutral or + /// white), analog balance and baseline exposure stay, plus its camera calibration when the + /// profile has the same calibration illuminants (DNG 6.3: calibration belongs to the camera, + /// the profile to the look). + pub fn applied_to(&self, color: &ColorData) -> ColorData { + let calibration = if self.color.illuminant == color.illuminant { color.camera_calibration } else { [None, None] }; + ColorData { + illuminant: self.color.illuminant, + color_matrix: self.color.color_matrix, + forward_matrix: self.color.forward_matrix, + camera_calibration: calibration, + analog_balance: color.analog_balance, + as_shot_neutral: color.as_shot_neutral, + as_shot_white_xy: color.as_shot_white_xy, + baseline_exposure: color.baseline_exposure + self.color.baseline_exposure, + baseline_sharpness: color.baseline_sharpness, + profile: crate::profile::ProfileLook { gain_table_map: color.profile.gain_table_map.clone(), ..self.color.profile.clone() }, + } + } +} + +/// Errors reading a `.dcp`. +#[derive(Debug, thiserror::Error, PartialEq, Eq)] +pub enum DcpError { + #[error("not a DNG camera profile (.dcp)")] + NotDcp, + #[error("damaged camera profile: {0}")] + Damaged(String), + #[error("the camera profile has no usable colour matrix")] + NoMatrix, +} + +/// Is `bytes` a DCP file (by its header)? +pub fn is_dcp(bytes: &[u8]) -> bool { + matches!(bytes.get(0..4), Some([b'I', b'I', b'R', b'C'] | [b'M', b'M', b'C', b'R'])) +} + +/// Parse a `.dcp` file. Files above 64 MiB are refused (real profiles are kilobytes to a few MB). +pub fn parse_dcp(bytes: &[u8]) -> Result { + if !is_dcp(bytes) { + return Err(DcpError::NotDcp); + } + if bytes.len() > 64 << 20 { + return Err(DcpError::Damaged("larger than 64 MiB".into())); + } + // the TIFF reader only knows 42 / BigTIFF / raw magics: give it a header with 42 in place of RC + let mut data = bytes.to_vec(); + let forty_two: [u8; 2] = if bytes.first() == Some(&b'I') { [42, 0] } else { [0, 42] }; + if let Some(m) = data.get_mut(2..4) { + m.copy_from_slice(&forty_two); + } + let opts = ParseOptions { follow_children: false, max_ifds: 4, value_budget: Some(64 << 20), ..Default::default() }; + let tiff = Tiff::parse_with(&data, &opts).map_err(|e| DcpError::Damaged(e.to_string()))?; + let ifd: &Ifd = tiff.ifds.first().ok_or_else(|| DcpError::Damaged("no IFD".into()))?; + let mut color = color_data(ifd, ifd, tiff.order); + // a profile carries no white balance or calibration of a particular shot + color.as_shot_neutral = None; + color.as_shot_white_xy = None; + color.analog_balance = None; + color.camera_calibration = [None, None]; + color.baseline_sharpness = None; + color.profile.gain_table_map = None; + // only BaselineExposureOffset belongs to a profile (BaselineExposure is the camera's) + color.baseline_exposure = + ifd.f64s(t::BASELINE_EXPOSURE_OFFSET).and_then(|v| v.first().copied()).filter(|v| v.is_finite()).unwrap_or(0.0).clamp(-4.0, 4.0); + // a single-illuminant profile names one illuminant; its second matrix slot stays empty + if color.color_matrix[0].is_none() { + // the first slot is the one every profile must fill (DNG: ColorMatrix1 is required) + return Err(DcpError::NoMatrix); + } + let text = |tag: u16| ifd.string(tag).map(|s| s.trim_matches(char::from(0)).trim().to_string()).unwrap_or_default(); + Ok(DcpProfile { name: text(t::PROFILE_NAME), camera_model: text(t::UNIQUE_CAMERA_MODEL), color }) +} + +/// Write `p` as a `.dcp` file (little-endian): its name, camera, illuminants, matrices, hue/saturation +/// map, look table, tone curve and baseline exposure offset. +pub fn write_dcp(p: &DcpProfile) -> Result, DcpError> { + use lightcraft_tiff::writer::srational; + use lightcraft_tiff::{ByteOrder, IfdBuilder, TiffWriter, Value}; + let c = &p.color; + let mut ifd = IfdBuilder::new(); + ifd.set(t::UNIQUE_CAMERA_MODEL, Value::Ascii(p.camera_model.clone())); + ifd.set(t::PROFILE_NAME, Value::Ascii(p.name.clone())); + let mat = |m: &lightcraft_color::Mat3| Value::SRational(m.0.iter().flatten().map(|v| srational(*v)).collect()); + for i in 0..2 { + if let Some(m) = &c.color_matrix[i] { + ifd.set([t::CALIBRATION_ILLUMINANT_1, t::CALIBRATION_ILLUMINANT_2][i], Value::Short(vec![c.illuminant[i]])); + ifd.set([t::COLOR_MATRIX_1, t::COLOR_MATRIX_2][i], mat(m)); + } + if let Some(m) = &c.forward_matrix[i] { + ifd.set([t::FORWARD_MATRIX_1, t::FORWARD_MATRIX_2][i], mat(m)); + } + } + let flat = |table: &crate::profile::HsvTable| Value::Float(table.data.iter().flatten().copied().collect()); + let dims = + |table: &crate::profile::HsvTable| Value::Long(vec![table.hue_divisions as u32, table.sat_divisions as u32, table.val_divisions as u32]); + if let Some(a) = c.profile.hue_sat_map[0].as_ref() { + ifd.set(t::PROFILE_HUE_SAT_MAP_DIMS, dims(a)); + ifd.set(t::PROFILE_HUE_SAT_MAP_DATA_1, flat(a)); + if a.srgb_value { + ifd.set(t::PROFILE_HUE_SAT_MAP_ENCODING, Value::Long(vec![1])); + } + if let Some(b) = c.profile.hue_sat_map[1] + .as_ref() + .filter(|b| (b.hue_divisions, b.sat_divisions, b.val_divisions) == (a.hue_divisions, a.sat_divisions, a.val_divisions)) + { + ifd.set(t::PROFILE_HUE_SAT_MAP_DATA_2, flat(b)); + } + } + if let Some(l) = &c.profile.look_table { + ifd.set(t::PROFILE_LOOK_TABLE_DIMS, dims(l)); + ifd.set(t::PROFILE_LOOK_TABLE_DATA, flat(l)); + if l.srgb_value { + ifd.set(t::PROFILE_LOOK_TABLE_ENCODING, Value::Long(vec![1])); + } + } + if let Some(tc) = &c.profile.tone_curve { + ifd.set(t::PROFILE_TONE_CURVE, Value::Float(tc.points.iter().flatten().copied().collect())); + } + if c.baseline_exposure != 0.0 { + ifd.set(t::BASELINE_EXPOSURE_OFFSET, Value::SRational(vec![srational(c.baseline_exposure)])); + } + let mut out = TiffWriter::new(ByteOrder::Little, false).write(&[ifd]).map_err(|e| DcpError::Damaged(e.to_string()))?; + // the DCP magic in place of 42 + if let Some(m) = out.get_mut(2..4) { + m.copy_from_slice(&DCP_MAGIC.to_le_bytes()); + } + Ok(out) +} + +#[cfg(test)] +mod tests { + use super::*; + + /// A minimal single-illuminant profile (our own numbers) built in memory: no profile file is + /// committed to the repository. + pub(crate) fn synthetic_dcp(little: bool, with_hue_sat: bool) -> Vec { + // entries: (tag, type, count, payload bytes) + let mut entries: Vec<(u16, u16, u32, Vec)> = Vec::new(); + let u16b = |v: u16| if little { v.to_le_bytes().to_vec() } else { v.to_be_bytes().to_vec() }; + let u32b = |v: u32| if little { v.to_le_bytes().to_vec() } else { v.to_be_bytes().to_vec() }; + let srat = |v: f64| { + let (n, d) = ((v * 10000.0).round() as i32, 10000i32); + let mut b = if little { n.to_le_bytes().to_vec() } else { n.to_be_bytes().to_vec() }; + b.extend(if little { d.to_le_bytes() } else { d.to_be_bytes() }); + b + }; + let ascii = |s: &str| { + let mut b = s.as_bytes().to_vec(); + b.push(0); + b + }; + entries.push((t::UNIQUE_CAMERA_MODEL, 2, 13, ascii("Test Camera1"))); + let m = [0.9, -0.3, -0.05, -0.4, 1.2, 0.2, -0.05, 0.15, 0.7]; + entries.push((t::COLOR_MATRIX_1, 10, 9, m.iter().flat_map(|v| srat(*v)).collect())); + entries.push((t::CALIBRATION_ILLUMINANT_1, 3, 1, [u16b(21), vec![0, 0]].concat())); + entries.push((t::PROFILE_NAME, 2, 9, ascii("My Look"))); + if with_hue_sat { + // 2 hues × 2 sats × 1 value: hue shift, sat scale, value scale per entry (FLOAT) + entries.push((t::PROFILE_HUE_SAT_MAP_DIMS, 4, 3, [u32b(2), u32b(2), u32b(1)].concat())); + let f = |v: f32| if little { v.to_le_bytes().to_vec() } else { v.to_be_bytes().to_vec() }; + entries.push(( + t::PROFILE_HUE_SAT_MAP_DATA_1, + 11, + 12, + [f(0.0), f(1.0), f(1.0), f(5.0), f(1.1), f(1.0), f(0.0), f(1.0), f(1.0), f(-5.0), f(0.9), f(1.0)].concat(), + )); + } + entries.sort_by_key(|e| e.0); + let mut out = if little { b"IIRC".to_vec() } else { b"MMCR".to_vec() }; + out.extend(u32b(8)); + let n = entries.len(); + let mut data_off = 8 + 2 + n * 12 + 4; + let mut ifd = u16b(n as u16); + let mut tail = Vec::new(); + for (tag, ty, count, payload) in &entries { + ifd.extend(u16b(*tag)); + ifd.extend(u16b(*ty)); + ifd.extend(u32b(*count)); + if payload.len() <= 4 { + let mut p = payload.clone(); + p.resize(4, 0); + ifd.extend(p); + } else { + ifd.extend(u32b(data_off as u32)); + tail.extend(payload); + data_off += payload.len(); + if data_off % 2 == 1 { + tail.push(0); + data_off += 1; + } + } + } + ifd.extend(u32b(0)); + out.extend(ifd); + out.extend(tail); + out + } + + #[test] + fn reads_a_single_illuminant_profile_in_both_byte_orders() { + for little in [true, false] { + let p = parse_dcp(&synthetic_dcp(little, true)).unwrap(); + assert_eq!(p.name, "My Look"); + assert_eq!(p.camera_model, "Test Camera1"); + assert_eq!(p.color.illuminant, [21, 0]); + let m = p.color.color_matrix[0].unwrap(); + assert!((m.0[1][1] - 1.2).abs() < 1e-4, "{m:?}"); + assert!(p.color.color_matrix[1].is_none()); + assert!(p.color.profile.hue_sat_map[0].is_some()); + assert!(p.color.as_shot_neutral.is_none()); + } + assert!(parse_dcp(&synthetic_dcp(true, false)).unwrap().color.profile.hue_sat_map[0].is_none()); + } + + #[test] + fn rejects_other_files_and_damage_without_panicking() { + assert_eq!(parse_dcp(b"II*\0\x08\0\0\0"), Err(DcpError::NotDcp)); + assert_eq!(parse_dcp(b""), Err(DcpError::NotDcp)); + let good = synthetic_dcp(true, true); + for cut in [4, 8, 10, 30, good.len() / 2, good.len() - 1] { + let _ = parse_dcp(&good[..cut]); + } + let mut bad = good.clone(); + bad[4..8].copy_from_slice(&u32::MAX.to_le_bytes()); + assert!(parse_dcp(&bad).is_err()); + } + + #[test] + fn written_profiles_read_back() { + let p = parse_dcp(&synthetic_dcp(false, true)).unwrap(); + let back = parse_dcp(&write_dcp(&p).unwrap()).unwrap(); + assert_eq!(back.name, p.name); + assert_eq!(back.camera_model, p.camera_model); + assert_eq!(back.color.illuminant, p.color.illuminant); + assert_eq!(back.color.profile.hue_sat_map, p.color.profile.hue_sat_map); + let (a, b) = (back.color.color_matrix[0].unwrap(), p.color.color_matrix[0].unwrap()); + assert!(a.0.iter().flatten().zip(b.0.iter().flatten()).all(|(x, y)| (x - y).abs() < 1e-6)); + } + + #[test] + fn applying_keeps_the_shot_and_replaces_the_look() { + let p = parse_dcp(&synthetic_dcp(true, true)).unwrap(); + let file = ColorData { as_shot_neutral: Some([0.5, 1.0, 0.7]), baseline_exposure: 0.25, ..Default::default() }; + let c = p.applied_to(&file); + assert_eq!(c.as_shot_neutral, Some([0.5, 1.0, 0.7])); + assert_eq!(c.color_matrix, p.color.color_matrix); + assert!(c.profile.hue_sat_map[0].is_some()); + assert!((c.baseline_exposure - 0.25).abs() < 1e-12); + } +} diff --git a/crates/raw/src/lib.rs b/crates/raw/src/lib.rs index 8a09a9edb4c..6e3a6fa840a 100644 --- a/crates/raw/src/lib.rs +++ b/crates/raw/src/lib.rs @@ -27,6 +27,7 @@ mod binned; pub mod color; +pub mod dcp; pub mod demosaic; mod dng; pub mod dngwrite; diff --git a/crates/ui-egui/examples/thumb_request_bench.rs b/crates/ui-egui/examples/thumb_request_bench.rs index 675c920d528..75bf04532ad 100644 --- a/crates/ui-egui/examples/thumb_request_bench.rs +++ b/crates/ui-egui/examples/thumb_request_bench.rs @@ -157,7 +157,7 @@ fn verify_texture(h: &Headless, id: PhotoId) { let edge = tex.size[0].max(tex.size[1]); assert!([128, 256, 384, 512].contains(&edge), "thumbnail must use a supported size bucket"); let Source::File { path } = &p.source else { unreachable!() }; - let (source, info) = h.app.session.media.file_loader.as_ref().unwrap()(path, 512).unwrap(); + let (source, info) = h.app.session.media.file_loader.as_ref().unwrap()(path, 512, None).unwrap(); println!("decode,path={path},raw={},preview_only={:?}", info.raw, p.preview_only); if std::env::var_os("REQUIRE_RAW").is_some() { assert!(p.preview_only.is_none(), "embedded-preview fallback does not validate RAW decoding"); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 9a387c77cd6..767b40a7fb2 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1385,7 +1385,7 @@ pub fn is_model_file(path: &str) -> bool { /// Files dropped on the window that are presets rather than photos. pub fn is_preset_file(path: &str) -> bool { let ext = std::path::Path::new(path).extension().map(|e| e.to_string_lossy().to_ascii_lowercase()).unwrap_or_default(); - ["lcpreset", "lrtemplate", "xmp", "zip", "cube", "lmp", "mplumpack"].contains(&ext.as_str()) + ["lcpreset", "lrtemplate", "xmp", "zip", "cube", "dcp", "lmp", "mplumpack"].contains(&ext.as_str()) } /// Splits dropped files into presets and everything else. An `.xmp` dropped next to a photo with the same diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index daf0f08e0ef..ad344de5aae 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -1513,12 +1513,12 @@ pub fn run_ui_command(app: &mut LightcraftApp, id: &str, p: &Value) -> Option = paths .iter() .filter(|p| { let l = p.to_ascii_lowercase(); - l.ends_with(".cube") || l.ends_with(".zip") || std::path::Path::new(p.as_str()).is_dir() + l.ends_with(".cube") || l.ends_with(".dcp") || l.ends_with(".zip") || std::path::Path::new(p.as_str()).is_dir() }) .collect(); // one toast for both halves (a second toast would replace the first) @@ -1550,7 +1550,14 @@ pub fn run_ui_command(app: &mut LightcraftApp, id: &str, p: &Value) -> Option = paths.iter().filter(|p| !p.to_ascii_lowercase().ends_with(".cube")).collect(); + // (.dcp camera profiles went to profile.import above) + let preset_paths: Vec<&String> = paths + .iter() + .filter(|p| { + let l = p.to_ascii_lowercase(); + !l.ends_with(".cube") && !l.ends_with(".dcp") + }) + .collect(); let r = if preset_paths.is_empty() { Ok(json!({"imported": [], "failed": [], "skipped": 0})) } else { diff --git a/crates/ui-egui/src/panels/edit.rs b/crates/ui-egui/src/panels/edit.rs index ed2ee46359f..46530d5f16c 100644 --- a/crates/ui-egui/src/panels/edit.rs +++ b/crates/ui-egui/src/panels/edit.rs @@ -443,16 +443,20 @@ fn profile_menu(app: &mut LightcraftApp, ui: &mut egui::Ui, d: &DevelopSettings) }); register(ui.ctx(), format!("profileMenu:groupMenu:{g}"), r.response.rect); } - // imported LUT profile groups - let mut lut_groups: Vec = app.session.lut_profiles.iter().map(|p| p.group.clone()).collect(); - lut_groups.sort_unstable(); - lut_groups.dedup(); + // imported profile groups: LUT folders, then camera profiles + let imported = app.session.imported_profiles(); + let mut lut_groups: Vec = Vec::new(); + for (_, _, g) in &imported { + if !lut_groups.contains(g) { + lut_groups.push(g.clone()); + } + } for g in &lut_groups { // a folder's name as it is, and its own widget id even when it matches a built-in group let r = ui.menu_button(g.as_str(), |ui| { ui.set_min_width(170.0); - for p in app.session.lut_profiles.iter().filter(|p| &p.group == g) { - item(ui, "group", &p.id, &p.name, &mut pick); + for (id, name, _) in imported.iter().filter(|p| &p.2 == g) { + item(ui, "group", id, name, &mut pick); } }); register(ui.ctx(), format!("profileMenu:lutGroupMenu:{g}"), r.response.rect); diff --git a/crates/ui-egui/src/panels/profiles.rs b/crates/ui-egui/src/panels/profiles.rs index 6294d1e64c2..b72ce4fe6d6 100644 --- a/crates/ui-egui/src/panels/profiles.rs +++ b/crates/ui-egui/src/panels/profiles.rs @@ -66,12 +66,16 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId) { PROFILES.iter().filter(|p| p.group == g).map(|p| (p.id.to_string(), p.name.to_string(), p.group.to_string())).collect(), )); } - // imported LUT profile groups - let mut lut_groups: Vec = app.session.lut_profiles.iter().map(|p| p.group.clone()).collect(); - lut_groups.sort_unstable(); - lut_groups.dedup(); + // imported profile groups: LUT folders, then camera profiles + let imported = app.session.imported_profiles(); + let mut lut_groups: Vec = Vec::new(); + for (_, _, g) in &imported { + if !lut_groups.contains(g) { + lut_groups.push(g.clone()); + } + } for g in &lut_groups { - let profiles = app.session.lut_profiles.iter().filter(|p| &p.group == g).map(|p| (p.id.clone(), p.name.clone(), p.group.clone())).collect(); + let profiles = imported.iter().filter(|p| &p.2 == g).cloned().collect(); sections.push((g.as_str(), "", true, profiles)); } for (title, tag, imported, list) in sections { diff --git a/crates/ui-egui/src/pick.rs b/crates/ui-egui/src/pick.rs index 1032a5cd984..90c3087110b 100644 --- a/crates/ui-egui/src/pick.rs +++ b/crates/ui-egui/src/pick.rs @@ -58,7 +58,7 @@ impl PickRequest { } /// What File ▸ Import Profiles & Presets… opens. -pub const PRESET_EXTENSIONS: &[&str] = &["lcpreset", "xmp", "lrtemplate", "zip", "dng", "lmp", "mplumpack", "cube"]; +pub const PRESET_EXTENSIONS: &[&str] = &["lcpreset", "xmp", "lrtemplate", "zip", "dng", "lmp", "mplumpack", "cube", "dcp"]; /// What Import Point Curve Presets… opens. pub const CURVE_PRESET_EXTENSIONS: &[&str] = &["lccurve", "json"]; diff --git a/crates/ui-egui/src/render.rs b/crates/ui-egui/src/render.rs index 66bce01ffba..e7fcb4a03ab 100644 --- a/crates/ui-egui/src/render.rs +++ b/crates/ui-egui/src/render.rs @@ -972,7 +972,7 @@ mod thumbnail_tests { fixture_with(Session::new(), (*photo()).clone()) } fn fixture_with(mut s: Session, photo: Photo) -> (crate::LightcraftApp, std::rc::Rc>, egui::Context) { - s.media.file_loader = Some(Arc::new(|_, _| { + s.media.file_loader = Some(Arc::new(|_, _, _| { let mut image = lightcraft_raster::Rgb32f::new(8, 8); image.data.fill([0.3, 0.2, 0.1]); Ok((image, Default::default())) @@ -1171,7 +1171,7 @@ mod thumbnail_tests { let photo = app.session.catalog.photo(PhotoId(1)).unwrap().as_ref().clone(); app.session = lightcraft_engine::Session::new(); app.session.catalog.apply(Op::AddPhoto { photo: Box::new(photo) }).unwrap(); - app.session.media.file_loader = Some(Arc::new(|_, _| { + app.session.media.file_loader = Some(Arc::new(|_, _, _| { let mut image = lightcraft_raster::Rgb32f::new(8, 8); image.data.fill([0.1, 0.2, 0.9]); Ok((image, Default::default())) diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 79c66b69c63..a4e2dc42a43 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-10 · **Change:** major (created; formats measured from the code and the target's Info.plist) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-12 · **Change:** minor (LR-PROF-IMPORT: the user's own `.dcp` camera profiles import) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 Every format Lightroom reads or writes, with our support, fidelity and tests. Camera raw formats are deep enough to have their own document: [raw-parity.md](raw-parity.md). @@ -48,7 +48,7 @@ import and export formats. Ours come from `crates/codecs/src/sniff.rs`, `crates/ | EXIF / IPTC / XMP embedded on export | ✅ | ✅ with metadata filters | `crates/meta` | | Develop presets `.xmp` | ✅ | ✅ import (mapping of supported settings) | | | Legacy presets `.lrtemplate` | ✅ (converted) | ✅ import | | -| Camera / creative profiles (`.dcp`, `.xmp` profiles) | ✅ | ⬜ deliberately (Adobe profile formats are never used); `.cube` LUT profiles ✅ | | +| Camera / creative profiles (`.dcp`, `.xmp` profiles) | ✅ | 🟡 the user's own `.dcp` camera profiles import (`profile.import`) and replace a raw file's colour model; none ship with the app; `.xmp` profiles ⬜; `.cube` LUT profiles ✅ | | | Lens profiles `.lcp` | ✅ | ⬜ deliberately | | | Other apps' presets | — | ✅ Luminar `.lmp` / `.mplumpack`, `.zip` bundles | beyond target | | Lightroom Classic catalog `.lrcat` | native | 🟡 import (ratings, flags, labels, keywords, collections, virtual copies, supported develop settings; read-only pure-Rust SQLite incl. WAL) | [lightroom-catalog-import.md](lightroom-catalog-import.md) | @@ -75,5 +75,6 @@ Remaining: **26–47 h** (AVIF decode 8–15 h if a permissive decoder is writte | Date | Change | Summary | |---|---|---| +| 2026-10-12 | minor | LR-PROF-IMPORT: the user's own DNG camera profiles (`.dcp`) import as camera profiles; none ship | | 2026-10-10 | major | Created from the code and the installed Lightroom's document types | | 2026-10-10 | minor | JPEG XL export (#247): JXL write ✅ (native only), PQ JPEG XL HDR | diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 77ae26e4c53..aa66fc62840 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -1,6 +1,6 @@ # Lightroom parity checklist -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-11 · **Change:** minor (rapid slider entry; LR-PROF-CAMERACOLOR: tone curve from black-and-white camera JPEGs; LR-VIEW-ZOOM, LR-VIEW-COMPARE: Compare and Reference zoom windows; LR-IMP-FORMATS, LR-IMP-CAMERA-COVERAGE: EOS R5 Mark II CR3 decodes; renamed from `parity.md`; Top gaps moved to gaps.md, shortcut notes to ui-parity.md; filesystem history retry/Undo/Redo evidence; renamed from `parity.md`; Top gaps moved to gaps.md, shortcut notes to ui-parity.md) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-12 · **Change:** minor (LR-PROF-IMPORT: the user's own `.dcp` camera profiles import; rapid slider entry; LR-PROF-CAMERACOLOR: tone curve from black-and-white camera JPEGs; LR-VIEW-ZOOM, LR-VIEW-COMPARE: Compare and Reference zoom windows; LR-IMP-FORMATS, LR-IMP-CAMERA-COVERAGE: EOS R5 Mark II CR3 decodes; renamed from `parity.md`; Top gaps moved to gaps.md, shortcut notes to ui-parity.md; filesystem history retry/Undo/Redo evidence; renamed from `parity.md`; Top gaps moved to gaps.md, shortcut notes to ui-parity.md) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 The measured, row-by-row checklist: one row per Lightroom feature, menu item and shortcut, what we have and what is missing. It answers *does the feature exist?* (feature breadth). Whether it is good @@ -53,9 +53,9 @@ cited here still exists. Formerly docs/parity.md. | Y. Menus | 84 | 0 | 4 | 8 | 47/47 (100%) | 23/23 (100%) | | Z. Keyboard shortcuts (desktop) | 76 | 3 | 3 | 1 | 49/52 (94%) | 23/24 (96%) | | Lightroom Classic extras | 34 | 16 | 35 | 8 | — | 24/26 (92%) | -| **Total** | 407 | 50 | 73 | 35 | 192/200 (96%) | 145/157 (92%) | +| **Total** | 408 | 51 | 72 | 35 | 193/201 (96%) | 145/157 (92%) | -Weighted completion (✅ = 1, 🟡 = ½, 🚫 left out): **81.5%** of 530 in-scope rows — P0 98.0% of 200 · P1 95.2% of 157 · P2 49.7% of 172. +Weighted completion (✅ = 1, 🟡 = ½, 🚫 left out): **81.6%** of 531 in-scope rows — P0 98.0% of 201 · P1 95.2% of 157 · P2 50.0% of 172. ## Top gaps and shortcut notes @@ -234,12 +234,12 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts). | LR-PROF-ADOBE | Standard raw looks (own equivalents) | P0 | ✅ | `crates/engine/src/presets.rs` (`PROFILES`), `crates/pipeline/src/profiles.rs` | six own looks: Color, Neutral, Vivid, Landscape, Portrait, Monochrome | | LR-PROF-ADAPTIVE | Adaptive profiles | P2 | ⬜ | | | | LR-PROF-CAMERA | Camera-matching looks | P2 | ⬜ | | | -| LR-PROF-CAMERACOLOR | Camera colour calibration (own) | P0 | 🟡 | `crates/raw/src/color.rs`, `crates/raw/src/profile.rs`, `crates/raw/src/gaintable.rs`, `crates/engine/src/camera_preview.rs` | DNG files use the colour matrices and the camera-profile look they carry (`ProfileHueSatMap`, `ProfileLookTable`, `ProfileToneCurve`, read from the file at run time per DNG spec ch. 6 — Lightroom-converted DNGs rendered flat and muted without them, issue #138). A DNG's `ProfileGainTableMap` / `ProfileGainTableMap2` (Apple ProRAW's local tone map; both versions, DNG 1.7 precedence, the file's byte order with a big-endian fallback) is read and written back by DNG export and not rendered by default, as Lightroom Classic renders ProRAW without it (measured on one CC0 iPhone 12 Pro ProRAW); the Profile option "Camera local tone mapping" (`profile.camera_local_tone`, per photo, off by default, `crates/pipeline/src/local_tone.rs`) renders it as the camera does, per output pixel in the scene-linear stage (CPU, also under the GPU path); Sony ARW, Nikon NEF, Panasonic RW2, Fujifilm RAF, Canon CR3 and CR2, Pentax PEF, Samsung SRW and Olympus ORF get a guarded file-local fit to their own embedded JPEG — chromaticity matrix + hue/saturation/value table + tone and chroma curves, relative WB — or, with a bundled or local per-model profile pooled from many photos (`lightcraft-cli calibrate`, ARW, NEF and RAF so far, `crates/engine/src/camera_profiles.rs`), the profile's colour and only their own tone/chroma curves (on 29 held-out ILCE-7M4 photos mean ΔE vs the camera JPEG 3.54 → 3.10; bundled ILCE-7CR from 125 photos: 26 held-out 4.07 → 3.29, and every one of the 131 photos accepted, 8 of which fell back to neutral without it), kept with smart previews (see docs/camera-preview-colour.md); Sony ARWs shot with DRO on (maker note `0xb025`, on by default) keep that colour but their tone curve is lowered to Sony's curve without DRO, whose lifted shadows are in the camera JPEG only (issue #244: 8 ILCE-7CR photos +6.4 → +0.8 L* from Lightroom's default, median ΔE 7.5 → 3.3); 52 models without a profile whose JPEG fit fails (or that have no usable JPEG) start from DNG-style matrices fitted to their measured spectral sensitivities instead of the neutral fallback (`crates/raw/src/spectral.rs`, rawtoaces-data v1.1.0, Apache-2.0, aliases included; not yet measured against the camera JPEG); ARW: on 10 public raw.pixls.us samples from 8 bodies 7 fits were accepted, mean ΔE vs the camera JPEG 17–26 → 3–10; NEF: 13 of 13 decodable samples (D750, D780, D850, D7500, Z 50 and local D7500 shots) accepted, ΔE 13–46 → 3–8 (issue #150); RW2 / RWL: 140 of 174 public samples accepted, from 93 of the 114 bodies with a preview, median ΔE 5.0 with matching lightness (13 of the 14 corpus files with a preview: ΔE 9.6–27 → 2.8–8.9; most rejections are compacts and kit zooms whose camera JPEG is distortion-corrected); a fit that fails the gates on all pixels is retried away from edges, where a lens-corrected camera JPEG still lines up (issue #232: the six distortion-corrected public ILCE-7RM2 samples ΔE 16.6–16.9 → 3.7–3.8, the corpus GX80 19.1 → 7.9); RAF: bundled X-H2S/X-T4 profiles from 201/545 photos; on 150 withheld files mean ΔE improves slightly over per-file fitting (X-H2S 1.70 → 1.62, X-T4 2.43 → 2.34); 23 of 24 references from 13 bodies accepted, including the dark X-H2S samples (8.74 → 2.25); ORF: the 3 decodable corpus files (E-1, E-400, XZ-2) accepted (`docs/camera-preview-colour.md`); a raw whose camera JPEG is black and white (a monochrome picture style) takes only the JPEG's tone curve, on the camera profile's, spectral or neutral colour (issue #577); this is not measured camera calibration; other raws and rejected fits use a neutral fallback (camera RGB ≈ linear sRGB, `matrix_is_fallback`) with as-shot white balance, so colours are muted and not accurate. Needs our own per-camera calibration: matrices the files carry themselves (e.g. Olympus `ColorMatrix`), fitting each camera to its own embedded JPEG, then chart shots. Adobe matrices / DCPs are never used. Biggest image-quality gap today | +| LR-PROF-CAMERACOLOR | Camera colour calibration (own) | P0 | 🟡 | `crates/raw/src/color.rs`, `crates/raw/src/profile.rs`, `crates/raw/src/gaintable.rs`, `crates/engine/src/camera_preview.rs` | DNG files use the colour matrices and the camera-profile look they carry (`ProfileHueSatMap`, `ProfileLookTable`, `ProfileToneCurve`, read from the file at run time per DNG spec ch. 6 — Lightroom-converted DNGs rendered flat and muted without them, issue #138). A DNG's `ProfileGainTableMap` / `ProfileGainTableMap2` (Apple ProRAW's local tone map; both versions, DNG 1.7 precedence, the file's byte order with a big-endian fallback) is read and written back by DNG export and not rendered by default, as Lightroom Classic renders ProRAW without it (measured on one CC0 iPhone 12 Pro ProRAW); the Profile option "Camera local tone mapping" (`profile.camera_local_tone`, per photo, off by default, `crates/pipeline/src/local_tone.rs`) renders it as the camera does, per output pixel in the scene-linear stage (CPU, also under the GPU path); Sony ARW, Nikon NEF, Panasonic RW2, Fujifilm RAF, Canon CR3 and CR2, Pentax PEF, Samsung SRW and Olympus ORF get a guarded file-local fit to their own embedded JPEG — chromaticity matrix + hue/saturation/value table + tone and chroma curves, relative WB — or, with a bundled or local per-model profile pooled from many photos (`lightcraft-cli calibrate`, ARW, NEF and RAF so far, `crates/engine/src/camera_profiles.rs`), the profile's colour and only their own tone/chroma curves (on 29 held-out ILCE-7M4 photos mean ΔE vs the camera JPEG 3.54 → 3.10; bundled ILCE-7CR from 125 photos: 26 held-out 4.07 → 3.29, and every one of the 131 photos accepted, 8 of which fell back to neutral without it), kept with smart previews (see docs/camera-preview-colour.md); Sony ARWs shot with DRO on (maker note `0xb025`, on by default) keep that colour but their tone curve is lowered to Sony's curve without DRO, whose lifted shadows are in the camera JPEG only (issue #244: 8 ILCE-7CR photos +6.4 → +0.8 L* from Lightroom's default, median ΔE 7.5 → 3.3); 52 models without a profile whose JPEG fit fails (or that have no usable JPEG) start from DNG-style matrices fitted to their measured spectral sensitivities instead of the neutral fallback (`crates/raw/src/spectral.rs`, rawtoaces-data v1.1.0, Apache-2.0, aliases included; not yet measured against the camera JPEG); ARW: on 10 public raw.pixls.us samples from 8 bodies 7 fits were accepted, mean ΔE vs the camera JPEG 17–26 → 3–10; NEF: 13 of 13 decodable samples (D750, D780, D850, D7500, Z 50 and local D7500 shots) accepted, ΔE 13–46 → 3–8 (issue #150); RW2 / RWL: 140 of 174 public samples accepted, from 93 of the 114 bodies with a preview, median ΔE 5.0 with matching lightness (13 of the 14 corpus files with a preview: ΔE 9.6–27 → 2.8–8.9; most rejections are compacts and kit zooms whose camera JPEG is distortion-corrected); a fit that fails the gates on all pixels is retried away from edges, where a lens-corrected camera JPEG still lines up (issue #232: the six distortion-corrected public ILCE-7RM2 samples ΔE 16.6–16.9 → 3.7–3.8, the corpus GX80 19.1 → 7.9); RAF: bundled X-H2S/X-T4 profiles from 201/545 photos; on 150 withheld files mean ΔE improves slightly over per-file fitting (X-H2S 1.70 → 1.62, X-T4 2.43 → 2.34); 23 of 24 references from 13 bodies accepted, including the dark X-H2S samples (8.74 → 2.25); ORF: the 3 decodable corpus files (E-1, E-400, XZ-2) accepted (`docs/camera-preview-colour.md`); a raw whose camera JPEG is black and white (a monochrome picture style) takes only the JPEG's tone curve, on the camera profile's, spectral or neutral colour (issue #577); this is not measured camera calibration; other raws and rejected fits use a neutral fallback (camera RGB ≈ linear sRGB, `matrix_is_fallback`) with as-shot white balance, so colours are muted and not accurate. Needs our own per-camera calibration: matrices the files carry themselves (e.g. Olympus `ColorMatrix`), fitting each camera to its own embedded JPEG, then chart shots. Adobe's matrices / DCPs are never shipped or used (a user can import their own `.dcp`, LR-PROF-IMPORT). Biggest image-quality gap today | | LR-PROF-CREATIVE | Creative profiles (own) | P2 | ✅ | `cmd:develop.profile`, `crates/pipeline/src/profiles.rs` | 16 own looks in Film / Cinematic / Muted / B&W (tone + point-curve fades, colour grading, mixer / B&W mix); scale with `ctl:profile.amount`; sliders untouched | | LR-PROF-LEGACY | Legacy profiles | P2 | ⬜ | | | | LR-PROF-NONRAW | Profiles for non-raw files | P0 | ✅ | `cmd:develop.profile` | same looks apply to JPEG/TIFF | | LR-PROF-AMOUNT | Profile amount | P1 | ✅ | `ctl:profile.amount` | | -| LR-PROF-IMPORT | Import profiles | P1 | ✅ | `cmd:profile.import`, `cmd:profile.deleteImported`, `crates/pipeline/src/lut.rs`, `crates/engine/src/cmd/lut_profiles.rs`, `crates/ui-egui/src/panels/edit.rs`, `crates/ui-egui/src/panels/profiles.rs` | `.cube` 3D LUTs (files, folders, zips) become creative profiles with Amount, grouped in the profile browser, kept with the library; rendered on the CPU; Adobe profile formats deliberately unsupported | +| LR-PROF-IMPORT | Import profiles | P1 | ✅ | `cmd:profile.import`, `cmd:profile.deleteImported`, `crates/pipeline/src/lut.rs`, `crates/engine/src/cmd/lut_profiles.rs`, `cmd:profiles.camera`, `cmd:profile.deleteCamera`, `crates/engine/src/cmd/dcp_profiles.rs`, `crates/raw/src/dcp.rs`, `crates/ui-egui/src/panels/edit.rs`, `crates/ui-egui/src/panels/profiles.rs` | `.cube` 3D LUTs (files, folders, zips) become creative profiles with Amount, grouped in the profile browser, kept with the library; rendered on the CPU; the user's own DNG camera profiles (`.dcp`: matrices, illuminants, hue/sat map, look table, tone curve) become camera profiles (`dcp:` ids, group Camera Profiles) that replace a raw file's colour model when it is decoded (a profile without a tone curve keeps the photo's own contrast; the photo is decoded again when the profile changes; smart previews and the web worker keep the file's own colour); none ship with the app; XMP camera/creative profiles unsupported | ## H. Crop & rotate (CROP) @@ -787,6 +787,7 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove | Date | Change | Summary | |---|---|---| +| 2026-10-12 | minor | LR-PROF-IMPORT: the user's own DNG camera profiles (`.dcp`) import as camera profiles; none ship | | 2026-10-11 | minor | KEY-SLIDER-TYPE: honor immediate Return/Escape and keep typed keys in the value editor; add regression references | | 2026-10-11 | minor | LR-PROF-CAMERACOLOR: raws with a black-and-white camera JPEG take its tone curve (issue #577) | | 2026-10-11 | minor | LR-VIEW-ZOOM and LR-VIEW-COMPARE: Compare and Reference are sharp at 1:1 (zoom windows per pane, two originals kept decoded while they are open); statuses unchanged | diff --git a/docs/raw-parity.md b/docs/raw-parity.md index 2b4b9efb5ec..b144fddc0bf 100644 --- a/docs/raw-parity.md +++ b/docs/raw-parity.md @@ -1,6 +1,6 @@ # RAW parity: cameras, formats, demosaic, colour and lens profiles -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-11 · **Change:** minor (EOS R5 Mark II decoded and verified: CRX QP-map escape, odd-height planes) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 (Camera Raw 18.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-12 · **Change:** minor (LR-PROF-IMPORT: the user's own `.dcp` camera profiles import) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 (Camera Raw 18.7) Raw processing is the deepest single dimension of Lightroom parity: a photographer whose camera does not decode, or decodes with the wrong colour, cannot switch. This document measures it model by @@ -187,7 +187,7 @@ sample files. A pointer for contributors, not legal advice. | Default profile per model | Adobe Standard for every model (1,500 profile names in the bundle) | the DNG's own matrices; else a pooled profile (**4 bundled**: ILCE-7CR, ILCE-7M4, X-H2S, X-T4); else a guarded per-file fit to the camera's embedded JPEG; else spectral matrices (**52 models**, rawtoaces-data); else a neutral matrix | | Camera Matching looks | 481 models (plus phone-maker looks) | none (the per-file JPEG fit imitates the camera's own look) | | Creative profiles | Adobe Color, Portrait, Landscape, Vivid, Monochrome… | our own looks (Color, Neutral, Vivid, Landscape, Portrait, Monochrome) | -| DCP / dual-illuminant model | ✅ | dual-illuminant DNG colour (ColorMatrix / ForwardMatrix 1-2, CameraCalibration, AnalogBalance), HueSatMap, LookTable, ProfileToneCurve; external `.dcp` never loaded (clean-room) | +| DCP / dual-illuminant model | ✅ | dual-illuminant DNG colour (ColorMatrix / ForwardMatrix 1-2, CameraCalibration, AnalogBalance), HueSatMap, LookTable, ProfileToneCurve; the user's own `.dcp` files can be imported as camera profiles (`crates/raw/src/dcp.rs`), none ship with the app (clean-room) | | White balance in Kelvin | ✅ for every model | absolute Kelvin where the camera has colour matrices (its own, or one of the 52 spectral rows), also for files whose look is a per-file fit (#730); other raws keep the relative scale (#296) | **How far the default rendering is from Adobe's** (CIE ΔE; measured where stated): @@ -266,6 +266,7 @@ Beyond decoding: | Date | Change | Summary | |---|---|---| +| 2026-10-12 | minor | LR-PROF-IMPORT: the user's own DNG camera profiles (`.dcp`) import as camera profiles; none ship | | 2026-10-10 | minor | Compressed ORF: pointer to the two Olympus patents that describe the method, as a clean-room starting point | | 2026-10-11 | minor | EOS R5 Mark II verified (CRX QP-map first literal and limited-length escape, odd-height Bayer planes; 4 CC0 files pinned, QP maps of 33,665 private files): 235 verified, 942 unverified; use-weighted 85% (42% on verified bodies); decoding 77%, RAW readiness unchanged at ~56% | | 2026-10-10 (later) | major | Model-by-model measurement against Adobe's published list (1,446 models: 234 verified, 943 unverified, 233 preview, 36 unsupported); `docs/raw/` data and re-measure script; use-weighted share 84% (40% on verified bodies); variant matrix; colour and lens sections with scores; ranked next cameras; RAW readiness ~56% from written parts | diff --git a/docs/roadmap.md b/docs/roadmap.md index f50d368867c..46fb2cbd431 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # Roadmap: milestones, current focus and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-10 · **Change:** major (created; milestones moved here from ROADMAP.md, focus re-ranked after the 2026-10-10 re-measure) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-12 · **Change:** minor (LR-PROF-IMPORT: the user's own `.dcp` camera profiles import) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 Forward-looking plan. The summary with the headline numbers is [ROADMAP.md](../ROADMAP.md); the ranked shortfalls are [gaps.md](gaps.md); the numbers come from [target-app-parity.md](target-app-parity.md). @@ -84,7 +84,7 @@ calibration: M0–M13 took ≈ 25 active hours against an estimate of ≈ 110– - **AI features** (subject / sky / people masks, generative remove) need model weights with licences we can ship; classical fallbacks first. No permissively licensed sky-segmentation or raw-denoise model was found; we may need to train our own. -- **Camera colour and lens data** is a data problem: we never use Adobe's matrices, DCPs or LCPs. +- **Camera colour and lens data** is a data problem: we never use Adobe's matrices, DCPs or LCPs (users may import their own `.dcp` camera profiles). DNG-embedded data first, then our own calibration; long-tail coverage grows over time and needs people with cameras, lenses and charts. - **Raw-format sources:** decoders are written from prose format descriptions (even ones published @@ -108,6 +108,7 @@ calibration: M0–M13 took ≈ 25 active hours against an estimate of ≈ 110– | Date | Change | Summary | |---|---|---| +| 2026-10-12 | minor | LR-PROF-IMPORT: the user's own DNG camera profiles (`.dcp`) import as camera profiles; none ship | | 2026-10-10 | minor | Beta hours 340–600; full ready ~59% in the gate note | | 2026-10-10 | minor | Added the Alpha gate table (core-workflow gate from the revised standard): passes, stays alpha | | 2026-10-10 | major | Created: milestones moved from ROADMAP.md (statuses refreshed: M3 ✅, M11 / M12 / M15 detail), current focus re-ranked toward beta, risks and design notes kept | diff --git a/docs/xmp-interop.md b/docs/xmp-interop.md index 3669d1199dd..c79bf9d70df 100644 --- a/docs/xmp-interop.md +++ b/docs/xmp-interop.md @@ -233,5 +233,20 @@ with a blend mode other than Normal or with a mask are reported, not applied. Bi or `.zip` bundles — as creative profiles: they appear in the profile browser under their folder's (or zip's) name and take the Amount slider (0–200 %) like the built-in looks. The LUT is applied to the finished, display-encoded colour (trilinear; `DOMAIN_MIN` / `DOMAIN_MAX` honoured; 1D LUTs are not supported); photos with a LUT profile render on the -CPU. A library on disk keeps a copy of each file in its `Profiles/` folder. Adobe's own profile formats (`.dcp`, XMP -camera/creative profiles with embedded tables) are deliberately not read. +CPU. A library on disk keeps a copy of each file in its `Profiles/` folder. XMP camera/creative profiles with embedded +tables are not read. + +## Profiles: camera profiles (`.dcp`) + +The same command (and File ▸ Import Profiles & Presets…, drag & drop) reads DNG Camera Profiles — the user's own `.dcp` +files, e.g. made with a colour-checker tool — as camera profiles (`dcp:-` ids, group *Camera Profiles*, +listed by `profiles.camera`). Read per DNG specification chapter 6 (`crates/raw/src/dcp.rs`): `ProfileName`, +`UniqueCameraModel`, `CalibrationIlluminant1/2`, `ColorMatrix1/2`, `ForwardMatrix1/2`, `ProfileHueSatMap*`, +`ProfileLookTable*`, `ProfileToneCurve` and `BaselineExposureOffset`. Choosing one (`develop.profile {id}`) replaces a raw +file's colour model when it is decoded — the file's own white balance, analog balance and baseline exposure stay, and a +profile without a `ProfileToneCurve` (most chart-made ones) keeps the photo's own contrast: the DNG's tone curve, else the +tone of the look fitted to its camera JPEG — so the +photo's source is decoded again when its profile changes; rendered (non-raw) photos ignore it. Smart previews and the +web build's render worker keep the file's own colour. A library on disk keeps a copy of each file in `Profiles/`; +`profile.deleteCamera` (or `profile.deleteImported`) removes one. No profile ships with LightCraft, and the repository +holds none: tests build theirs in memory (`lightcraft_raw::dcp::write_dcp`). From 4a5ef6f66f68d610834f7772b5f181375fcbf175 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Tue, 13 Oct 2026 16:59:26 +1000 Subject: [PATCH 02/27] LR-PROF-IMPORT: build against upstream main (kelvin_presets, 3-arg loaders) DcpProfile::applied_to keeps the file's white-balance presets (new ColorData::kelvin_presets upstream): they are camera facts like as-shot neutral. Upstream's new FileLoader test closures take the profile argument. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/media.rs | 2 +- crates/raw/src/dcp.rs | 7 ++++--- crates/ui-egui/src/render.rs | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/media.rs b/crates/engine/src/media.rs index 2396bd3eca1..d597e354873 100644 --- a/crates/engine/src/media.rs +++ b/crates/engine/src/media.rs @@ -1712,7 +1712,7 @@ mod thumbnail_hash_tests { #[test] fn a_render_that_panics_fails_instead_of_never_answering() { let mut s = session(); - s.media.file_loader = Some(Arc::new(|_, _| panic!("decoder bug"))); + s.media.file_loader = Some(Arc::new(|_, _, _| panic!("decoder bug"))); let mut job = s.thumb_job(PhotoId(1), 256).unwrap(); job.request_id = 42; let (key, level, source_key) = (job.key, job.level, job.source_key); diff --git a/crates/raw/src/dcp.rs b/crates/raw/src/dcp.rs index 0f2aa95fe94..d208bfa008f 100644 --- a/crates/raw/src/dcp.rs +++ b/crates/raw/src/dcp.rs @@ -26,9 +26,9 @@ pub struct DcpProfile { impl DcpProfile { /// `color` (a raw file's own colour facts) with this profile's colour model in place of the /// file's: its matrices, illuminants and look. The file's white balance (as-shot neutral or - /// white), analog balance and baseline exposure stay, plus its camera calibration when the - /// profile has the same calibration illuminants (DNG 6.3: calibration belongs to the camera, - /// the profile to the look). + /// white, and its white-balance presets), analog balance and baseline exposure stay, plus its + /// camera calibration when the profile has the same calibration illuminants (DNG 6.3: + /// calibration belongs to the camera, the profile to the look). pub fn applied_to(&self, color: &ColorData) -> ColorData { let calibration = if self.color.illuminant == color.illuminant { color.camera_calibration } else { [None, None] }; ColorData { @@ -42,6 +42,7 @@ impl DcpProfile { baseline_exposure: color.baseline_exposure + self.color.baseline_exposure, baseline_sharpness: color.baseline_sharpness, profile: crate::profile::ProfileLook { gain_table_map: color.profile.gain_table_map.clone(), ..self.color.profile.clone() }, + kelvin_presets: color.kelvin_presets, } } } diff --git a/crates/ui-egui/src/render.rs b/crates/ui-egui/src/render.rs index fd973a54859..1c46f92830a 100644 --- a/crates/ui-egui/src/render.rs +++ b/crates/ui-egui/src/render.rs @@ -1011,7 +1011,7 @@ mod thumbnail_tests { #[test] fn a_fast_draft_is_drawn_in_the_frame_that_asked_for_it() { let mut s = Session::new(); - s.media.file_loader = Some(Arc::new(|_, _| Ok((lightcraft_raster::Rgb32f::new(8, 8), Default::default())))); + s.media.file_loader = Some(Arc::new(|_, _, _| Ok((lightcraft_raster::Rgb32f::new(8, 8), Default::default())))); s.catalog.apply(Op::AddPhoto { photo: Box::new((*photo()).clone()) }).unwrap(); let mut r = Renderer::with_worker_threads(1); let ctx = egui::Context::default(); @@ -1160,7 +1160,7 @@ mod thumbnail_tests { #[test] fn a_panicking_render_is_a_failure_not_a_dead_worker() { let (mut app, _, ctx) = fixture_with(Session::new(), (*photo()).clone()); - app.session.media.file_loader = Some(Arc::new(|_, _| panic!("decoder bug"))); + app.session.media.file_loader = Some(Arc::new(|_, _, _| panic!("decoder bug"))); app.renderer.offload = None; // the real job pool let slot = Slot::Thumb(PhotoId(1)); let ask = |app: &mut crate::LightcraftApp| { From ba03cfe1352d04912b6ca69e87eeea6970930177 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Tue, 13 Oct 2026 22:56:56 +1000 Subject: [PATCH 03/27] LR-PROF-IMPORT: hover previews and browser thumbnails develop the hovered camera profile The loupe's hover preview (preview_job) and the profile browser's thumbnails (variant_job) took the photo's own decoded source, so hovering an imported camera profile showed the built-in colour (and hovering a built-in profile while one was applied kept the camera profile's). Both now decode as the hovered settings develop: the source follows the settings' camera profile, as the main render does, and a variant's cache key already follows its settings. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/media.rs | 12 ++++++++- crates/engine/src/tests_dcp.rs | 46 ++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/media.rs b/crates/engine/src/media.rs index d597e354873..f833bbaa389 100644 --- a/crates/engine/src/media.rs +++ b/crates/engine/src/media.rs @@ -1241,6 +1241,14 @@ impl crate::Session { /// temporary preview while hovering a preset or profile; nothing is committed or cached). pub fn preview_job(&mut self, id: PhotoId, max_w: usize, max_h: usize, apply_crop: bool, settings: &DevelopSettings) -> Option { let mut job = self.render_job(id, max_w, max_h, false, apply_crop)?; + // the source as these settings develop it: another camera profile (or none) decodes anew + let mut p = (**self.catalog.photo(id)?).clone(); + if self.media.camera_profile_of(&p).map(|c| c.0) != { + p.develop = Arc::new(settings.clone()); + self.media.camera_profile_of(&p).map(|c| c.0) + } { + job.source = self.media.source_ref(&p, job.level); + } job.settings = Arc::new(settings.clone()); job.key = settings.hash64() ^ ((max_w as u64) << 40) ^ ((max_h as u64) << 20) ^ (apply_crop as u64) ^ (job.level as u64) << 60; Some(job) @@ -1264,9 +1272,11 @@ impl crate::Session { /// hash, so a variant renders once; `key` is derived from the same hash, so a frontend can /// keep one texture per variant. pub fn variant_job(&mut self, id: PhotoId, settings: &DevelopSettings, edge: usize) -> Option { - let p = self.catalog.photo(id)?.clone(); + let mut p = (**self.catalog.photo(id)?).clone(); let edge = edge.clamp(16, SourceLevel::Thumb.max_edge()); let level = SourceLevel::Thumb; + // decoded as these settings develop it (their camera profile, or none) + p.develop = Arc::new(settings.clone()); let source = self.media.source_ref(&p, level); let ck = Self::variant_key(&p, settings, edge); Some(RenderJob { diff --git a/crates/engine/src/tests_dcp.rs b/crates/engine/src/tests_dcp.rs index aa3c791681d..d850105ed10 100644 --- a/crates/engine/src/tests_dcp.rs +++ b/crates/engine/src/tests_dcp.rs @@ -139,3 +139,49 @@ fn import_choose_cache_persist_and_delete() { assert!(s.execute("develop.profile", &json!({"id": dcp_id})).is_err(), "no longer a known profile"); let _ = std::fs::remove_dir_all(&dir); } + +/// Hovering a camera profile (the loupe's preview, the browser's thumbnails) develops the photo with +/// it, and hovering a built-in profile while one is applied develops without it. Before, both used +/// the photo's own decode: a camera profile's colour never showed in a hover. +#[test] +fn hover_previews_and_browser_thumbnails_decode_with_the_hovered_camera_profile() { + let dir = temp_dir("hover"); + let (lib, files) = (dir.join("lib"), dir.join("files")); + std::fs::create_dir_all(&files).unwrap(); + let raw = files.join("IMG_0002.dng"); + std::fs::write(&raw, crate::tests_xmp::synthetic_dng_with(None, Default::default())).unwrap(); + let dcp_file = files.join("Swap.dcp"); + std::fs::write(&dcp_file, write_dcp(&swapping_profile("Swap")).unwrap()).unwrap(); + let mut s = Session::new().with_fs(); + s.open_library(&lib, false).unwrap(); + let r = s.execute("library.import", &json!({"paths": [raw.to_string_lossy()]})).unwrap(); + let id = PhotoId(r["imported"][0].as_u64().unwrap()); + s.execute("library.select", &json!({"ids": [id.0]})).unwrap(); + let dcp_id = + s.execute("profile.import", &json!({"paths": [dcp_file.to_string_lossy()]})).unwrap()["imported"][0]["id"].as_str().unwrap().to_string(); + let mean = |j: crate::media::RenderJob| { + let img = j.run().rendered.unwrap().image; + let n = img.data.len().max(1) as f64; + img.data.iter().fold([0.0f64; 3], |a, p| [a[0] + f64::from(p[0]) / n, a[1] + f64::from(p[1]) / n, a[2] + f64::from(p[2]) / n]) + }; + let differ = |a: [f64; 3], b: [f64; 3]| a.iter().zip(b).any(|(x, y)| (x - y).abs() > 2.0); + let close = |a: [f64; 3], b: [f64; 3]| a.iter().zip(b).all(|(x, y)| (x - y).abs() < 0.6); + let own = (*s.develop_of(id).unwrap()).clone(); + let mut hovered = own.clone(); + hovered.profile.id = dcp_id.clone(); + let builtin = mean(s.render_job(id, 64, 64, false, true).unwrap()); + let hover = mean(s.preview_job(id, 64, 64, true, &hovered).unwrap()); + assert!(differ(hover, builtin), "the hover shows the camera profile: {hover:?} vs {builtin:?}"); + // the browser's thumbnail too, under its own cache key + let (va, vb) = (s.variant_job(id, &own, 64).unwrap(), s.variant_job(id, &hovered, 64).unwrap()); + assert_ne!(va.cache.as_ref().unwrap().1, vb.cache.as_ref().unwrap().1); + assert!(matches!(&vb.source, SourceRef::File { camera_profile: Some(_), .. }), "decoded with the camera profile"); + assert!(differ(mean(va), mean(vb))); + // selected: the same picture as the hover; hovering the built-in profile then: without it + s.execute("develop.profile", &json!({"id": dcp_id})).unwrap(); + let selected = mean(s.render_job(id, 64, 64, false, true).unwrap()); + assert!(close(hover, selected), "{hover:?} vs {selected:?}"); + let back = mean(s.preview_job(id, 64, 64, true, &own).unwrap()); + assert!(close(back, builtin), "{back:?} vs {builtin:?}"); + let _ = std::fs::remove_dir_all(&dir); +} From c8c9904d8b843903951b9dd559f6cc3722137a44 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Thu, 15 Oct 2026 12:31:30 +1000 Subject: [PATCH 04/27] LR-PROF-IMPORT: build against upstream main (face-tile test loader and render_bench take the camera profile) Co-Authored-By: Claude Opus 5.5 --- crates/engine/examples/render_bench.rs | 2 +- crates/engine/src/tests_face_tiles.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/engine/examples/render_bench.rs b/crates/engine/examples/render_bench.rs index 3d7dbc4453b..b299043ee86 100644 --- a/crates/engine/examples/render_bench.rs +++ b/crates/engine/examples/render_bench.rs @@ -149,7 +149,7 @@ fn main() { } println!(" {:<36} {}", "load_bytes(2560):", best(n, || drop(lightcraft_engine::files::load_bytes(&bytes, 2560).expect("load")))); let (loader, _) = lightcraft_engine::files::fs_hooks(); - println!(" {:<36} {}", "fs loader (2560, read+load):", best(n, || drop(loader(path, 2560).expect("load")))); + println!(" {:<36} {}", "fs loader (2560, read+load):", best(n, || drop(loader(path, 2560, None).expect("load")))); } return; } diff --git a/crates/engine/src/tests_face_tiles.rs b/crates/engine/src/tests_face_tiles.rs index 3af23f0da1b..14902a4ea7e 100644 --- a/crates/engine/src/tests_face_tiles.rs +++ b/crates/engine/src/tests_face_tiles.rs @@ -91,9 +91,9 @@ fn count_loads(s: &mut Session) -> Loads { let loads = Loads::default(); let file = s.media.file_loader.clone().unwrap(); let n = loads.files.clone(); - s.media.file_loader = Some(Arc::new(move |p: &str, e: usize| { + s.media.file_loader = Some(Arc::new(move |p: &str, e: usize, dcp: Option<&crate::media::DcpProfile>| { n.fetch_add(1, Ordering::SeqCst); - file(p, e) + file(p, e, dcp) })); let preview = s.media.preview_loader.clone().unwrap(); let n = loads.previews.clone(); From 96e46fce239b7fa5cae766c6e955d62f32b5dbfc Mon Sep 17 00:00:00 2001 From: OneSlips Date: Thu, 15 Oct 2026 16:13:36 +1000 Subject: [PATCH 05/27] CI: the catalog's staging-link test module is Unix-only (unused import broke clippy on Windows) Co-Authored-By: Claude Opus 5.5 --- crates/catalog/src/store.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/catalog/src/store.rs b/crates/catalog/src/store.rs index 2f3dc4912b4..f3ce057159e 100644 --- a/crates/catalog/src/store.rs +++ b/crates/catalog/src/store.rs @@ -242,13 +242,13 @@ impl Store for MemStore { } } -#[cfg(test)] +// (its one test plants a symlink, so the module is Unix-only: elsewhere `use super::*` would be unused) +#[cfg(all(test, unix))] mod tests_staging { use super::*; /// A link planted at a staging name (`.tmp`) is removed, never followed: the file it points to keeps its /// bytes and the save still lands (issue #1502). - #[cfg(unix)] #[test] fn a_link_at_the_staging_name_is_never_written_through() { let dir = std::env::temp_dir().join(format!("lc-staging-link-{}", std::process::id())); From d1313b7b9ee5ed3f68468c8ce95ff5019e68bc2b Mon Sep 17 00:00:00 2001 From: OneSlips Date: Thu, 15 Oct 2026 16:32:37 +1000 Subject: [PATCH 06/27] CI: same-folder export test expects the '/'-joined subfolder (failed on Windows) Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/tests_export.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/tests_export.rs b/crates/engine/src/tests_export.rs index 2f1a051168b..ec70d610bea 100644 --- a/crates/engine/src/tests_export.rs +++ b/crates/engine/src/tests_export.rs @@ -991,7 +991,8 @@ fn same_folder_as_original_exports_next_to_each_photo() { let exists = |p: &str| std::path::Path::new(p).exists(); let files = crate::export::export_batch(&mut s, &ids, &o, &to, &mut crate::export::write_file, &exists).unwrap(); let written: Vec<&str> = files.iter().map(|f| f["path"].as_str().unwrap()).collect(); - let mut want = vec![a.join("Exports/IMG_1.jpg").to_string_lossy().to_string(), b.join("Exports/IMG_1.jpg").to_string_lossy().to_string()]; + // (the subfolder is joined with `/` on every platform, `export::join_path`) + let mut want = vec![format!("{}/Exports/IMG_1.jpg", a.to_string_lossy()), format!("{}/Exports/IMG_1.jpg", b.to_string_lossy())]; let mut got: Vec = written.iter().map(|p| p.to_string()).collect(); want.sort(); got.sort(); From af265c5d405c8fabb7c160d0848e59a7c4330c8a Mon Sep 17 00:00:00 2001 From: OneSlips Date: Thu, 15 Oct 2026 16:46:44 +1000 Subject: [PATCH 07/27] CI: folder-drop tests build widget ids with the Folders tree's '/' paths (failed on Windows) Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/tests_folder_drop.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/tests_folder_drop.rs b/crates/ui-egui/src/tests_folder_drop.rs index 9b4cb860a27..3010ddb1a85 100644 --- a/crates/ui-egui/src/tests_folder_drop.rs +++ b/crates/ui-egui/src/tests_folder_drop.rs @@ -50,8 +50,13 @@ fn widget(h: &Headless, id: &str) -> Option { h.app.widgets.iter().find(|(w, _)| w == id).map(|(_, r)| *r) } +/// `dir` as the Folders tree writes it in widget ids: with `/` on every platform. +fn slashed(dir: &Path) -> String { + dir.to_string_lossy().replace('\\', "/") +} + fn folder_row(h: &Headless, dir: &Path) -> Option { - widget(h, &format!("source:libfolder:{}", dir.to_string_lossy())) + widget(h, &format!("source:libfolder:{}", slashed(dir))) } fn id_of(h: &Headless, file: &str) -> u64 { @@ -180,7 +185,7 @@ fn photos_already_in_the_folder_stay_put() { let (root, trip, home) = folders("here"); let mut h = app(&[(trip.join("beach.png"), false), (home.join("garden.png"), false)]); // open the folder holding both - let toggle = widget(&h, &format!("libraryFolderToggle:{}", root.to_string_lossy())).unwrap(); + let toggle = widget(&h, &format!("libraryFolderToggle:{}", slashed(&root))).unwrap(); h.app.synthetic.push(egui::Event::PointerMoved(toggle.center())); h.app.synthetic.push(egui::Event::PointerButton { pos: toggle.center(), @@ -284,7 +289,7 @@ fn cancelling_the_question_moves_nothing() { let target = if folder_row(&h, &home).is_some() { target } else { - click(&mut h, &format!("libraryFolderToggle:{}", root.to_string_lossy())); + click(&mut h, &format!("libraryFolderToggle:{}", slashed(&root))); folder_row(&h, &home).unwrap() }; let undo = h.app.session.undo.len(); @@ -302,7 +307,7 @@ fn dont_ask_again_moves_the_next_drop_at_once() { let (root, trip, home) = folders("dont-ask"); std::fs::copy(trip.join("beach.png"), trip.join("dunes.png")).unwrap(); let mut h = app(&[(trip.join("beach.png"), false), (trip.join("dunes.png"), false), (home.join("garden.png"), false)]); - click(&mut h, &format!("libraryFolderToggle:{}", root.to_string_lossy())); + click(&mut h, &format!("libraryFolderToggle:{}", slashed(&root))); let target = folder_row(&h, &home).unwrap(); let beach = id_of(&h, "beach.png"); h.app.session.selection = lightcraft_engine::Selection::single(lightcraft_catalog::PhotoId(beach)); @@ -327,7 +332,7 @@ fn dont_ask_again_moves_the_next_drop_at_once() { fn a_question_left_open_while_another_library_opens_moves_nothing() { let (root, trip, home) = folders("other-library"); let mut h = app(&[(trip.join("beach.png"), false), (home.join("garden.png"), false)]); - click(&mut h, &format!("libraryFolderToggle:{}", root.to_string_lossy())); + click(&mut h, &format!("libraryFolderToggle:{}", slashed(&root))); let beach = id_of(&h, "beach.png"); let target = folder_row(&h, &home).unwrap(); drop_beach(&mut h, beach, target); From cb20494ee3bc7174ef448a8e100b85151fe48cda Mon Sep 17 00:00:00 2001 From: OneSlips Date: Thu, 15 Oct 2026 17:03:46 +1000 Subject: [PATCH 08/27] LR-PROF-IMPORT: rustfmt after merging main Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/files.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/files.rs b/crates/engine/src/files.rs index 93ba5ac5df3..4e9e9a50255 100644 --- a/crates/engine/src/files.rs +++ b/crates/engine/src/files.rs @@ -540,7 +540,8 @@ fn load_bytes_now( let tags = lightcraft_raw::ColorData { profile: Default::default(), ..raw.color.clone() }; Arc::new(lightcraft_pipeline::CameraColor { tags, developed_for: xy }) }); - let camera_tone = camera_look.as_ref().map(|p| p.tone).or_else(|| raw.color.profile.tone_curve.as_ref().and_then(dng_tone_curve)).or(kept_tone); + let camera_tone = + camera_look.as_ref().map(|p| p.tone).or_else(|| raw.color.profile.tone_curve.as_ref().and_then(dng_tone_curve)).or(kept_tone); let local_tone = local_tone(&raw); let (temp, tint) = scale.as_shot(xy); return Ok(( From f911c7dbb9605317f8bbdeacd17ae721f9b24eec Mon Sep 17 00:00:00 2001 From: OneSlips Date: Thu, 22 Oct 2026 03:04:37 +1000 Subject: [PATCH 09/27] LR-PROF-IMPORT: a real D750 camera profile as a pinned test corpus, checked against Lightroom dieli's CC0 Nikon D750 ColorChecker set (Calibrite PROFILER dual-illuminant DCP, matrix-only; the two chart NEFs; Lightroom Classic 15.6 renders with the profile) is fetched by cargo xtask corpus --download into corpus/d750-colorchecker/, pinned to commit f37f4054 and by sha256; nothing is committed. Tests (skip without the corpus): the profile parses as matrix-only with Cool White Fluorescent + D55; the matrices blend by inverse temperature; the matrix-only path inverts the colour matrix and adapts to D50; it takes over the chart NEFs' colour; imported and applied end to end, the charts develop within mean dE2000 3.84 (flash) / 3.35 (indoor) of Lightroom's renders. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/lib.rs | 2 + crates/engine/src/tests_dcp_corpus.rs | 243 ++++++++++++++++++++++++++ crates/raw/tests/dcp_corpus.rs | 148 ++++++++++++++++ docs/parity-checklist.md | 5 +- docs/raw-parity.md | 5 +- xtask/src/main.rs | 96 +++++++--- 6 files changed, 473 insertions(+), 26 deletions(-) create mode 100644 crates/engine/src/tests_dcp_corpus.rs create mode 100644 crates/raw/tests/dcp_corpus.rs diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index a24f312c33b..961f64dcf72 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1256,6 +1256,8 @@ mod tests_crop_angle; #[cfg(test)] mod tests_dcp; #[cfg(test)] +mod tests_dcp_corpus; +#[cfg(test)] mod tests_denoise; #[cfg(test)] mod tests_export; diff --git a/crates/engine/src/tests_dcp_corpus.rs b/crates/engine/src/tests_dcp_corpus.rs new file mode 100644 index 00000000000..48ed68467da --- /dev/null +++ b/crates/engine/src/tests_dcp_corpus.rs @@ -0,0 +1,243 @@ +//! A real camera profile end to end: the Nikon D750 ColorChecker DCP and chart NEFs dieli released +//! under CC0 (github.com/dieli/d750-lightcraft-colorchecker, pinned in `D750_COLORCHECKER`, +//! xtask/src/main.rs; `cargo xtask corpus --download`). Each chart is imported, developed with the +//! imported profile, white balanced on the second-lightest grey patch (as in the reference) and +//! exported as sRGB; the 24 patches are then compared in CIELAB (ΔE2000) with Lightroom Classic +//! 15.6's render of the same NEF with the same profile. +//! +//! The comparison is lenient on purpose: the profile is matrix-only, so the colour model is the same, +//! but Lightroom adds its own default tone curve and rendering, which LightCraft does not copy. The +//! test pins the measured agreement against regressions (see `MEAN_LIMIT`, `MAX_LIMIT`) and prints +//! every patch's ΔE. Missing files are reported as skipped. + +use std::path::{Path, PathBuf}; + +use lightcraft_catalog::PhotoId; +use serde_json::json; + +use crate::Session; +use crate::export::{ExportOptions, export_photo}; + +/// Upper bounds for the mean and the largest patch ΔE2000 against Lightroom. Measured when this test +/// was written (2026-10-22): daylight/flash mean 3.84, max 7.77 (patch 16, yellow); indoor mean 3.35, +/// max 5.24 (patch 13, blue). The grey row agrees within about 1-3; the colour patches come out less +/// saturated than Lightroom's (its own rendering on top of the profile), which is most of the rest. +const MEAN_LIMIT: f64 = 5.0; +const MAX_LIMIT: f64 = 10.0; + +fn set_dir() -> PathBuf { + std::env::var_os("LIGHTCRAFT_CORPUS") + .map(PathBuf::from) + .unwrap_or_else(|| Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus")) + .join("d750-colorchecker") +} + +/// Patch centres (row-major, normalized x, y) in Lightroom's render of each chart, a crop around the +/// ColorChecker. Row 4 is the grey row, white to black. +fn reference_centres(chart: &str) -> Vec<(f64, f64)> { + let (xs, ys): (&[f64], &[f64]) = if chart.contains("indoor") { + (&[193.0, 361.0, 527.0, 692.0, 857.0, 1022.0], &[152.0, 318.0, 486.0, 660.0]) + } else { + (&[197.0, 378.0, 555.0, 731.0, 906.0, 1080.0], &[135.0, 312.0, 490.0, 668.0]) + }; + ys.iter().flat_map(|y| xs.iter().map(move |x| (x / 1200.0, y / 801.0))).collect() +} + +/// The same patches in the whole NEF frame (our export, uncropped), read off a 1200 × 802 render. +fn frame_centres(chart: &str) -> Vec<(f64, f64)> { + let (xs, ys): (&[f64], &[f64]) = if chart.contains("indoor") { + (&[468.0, 528.0, 587.0, 645.0, 704.0, 765.0], &[527.0, 585.0, 644.0, 705.0]) + } else { + (&[462.0, 512.0, 560.0, 609.0, 658.0, 706.0], &[381.0, 430.0, 479.0, 529.0]) + }; + ys.iter().flat_map(|y| xs.iter().map(move |x| (x / 1200.0, y / 802.0))).collect() +} + +/// Mean CIELAB (D50) of a box of half-width `radius` (a fraction of the image width) around each +/// centre, and the largest standard deviation of L* inside a box (a box on a patch edge shows up there). +fn patch_labs(bytes: &[u8], centres: &[(f64, f64)], radius: f64) -> (Vec<[f64; 3]>, f64) { + let d = lightcraft_codecs::decode(bytes, Default::default()).unwrap(); + let to_xyz = d.space.to_xyz_d50; + let (w, h) = (d.image.width, d.image.height); + let r = (w as f64 * radius).max(1.0) as isize; + let mut worst = 0.0f64; + let labs = centres + .iter() + .map(|&(x, y)| { + let (cx, cy) = ((x * w as f64) as isize, (y * h as f64) as isize); + let (mut acc, mut ls) = ([0.0f64; 3], Vec::new()); + for yy in (cy - r).max(0)..(cy + r).min(h as isize) { + for xx in (cx - r).max(0)..(cx + r).min(w as isize) { + let p = d.image.data[yy as usize * w + xx as usize]; + let rgb = [f64::from(p[0]), f64::from(p[1]), f64::from(p[2])]; + for (a, v) in acc.iter_mut().zip(rgb) { + *a += v; + } + ls.push(lab(to_xyz.apply(rgb))[0]); + } + } + let n = ls.len().max(1) as f64; + let mean_l = ls.iter().sum::() / n; + worst = worst.max((ls.iter().map(|l| (l - mean_l).powi(2)).sum::() / n).sqrt()); + lab(to_xyz.apply(acc.map(|v| v / n))) + }) + .collect(); + (labs, worst) +} + +fn lab(xyz: [f64; 3]) -> [f64; 3] { + let white = [0.9642, 1.0, 0.8249]; + let f = |t: f64| if t > 216.0 / 24389.0 { t.cbrt() } else { (24389.0 / 27.0 * t + 16.0) / 116.0 }; + let [fx, fy, fz] = [f(xyz[0] / white[0]), f(xyz[1] / white[1]), f(xyz[2] / white[2])]; + [116.0 * fy - 16.0, 500.0 * (fx - fy), 200.0 * (fy - fz)] +} + +/// CIEDE2000 (Sharma, Wu and Dalal 2005). +fn de2000(a: [f64; 3], b: [f64; 3]) -> f64 { + use std::f64::consts::PI; + let (l1, a1, b1, l2, a2, b2) = (a[0], a[1], a[2], b[0], b[1], b[2]); + let c_bar = ((a1 * a1 + b1 * b1).sqrt() + (a2 * a2 + b2 * b2).sqrt()) / 2.0; + let g = 0.5 * (1.0 - (c_bar.powi(7) / (c_bar.powi(7) + 25f64.powi(7))).sqrt()); + let (a1p, a2p) = ((1.0 + g) * a1, (1.0 + g) * a2); + let (c1p, c2p) = ((a1p * a1p + b1 * b1).sqrt(), (a2p * a2p + b2 * b2).sqrt()); + let hue = |b: f64, a: f64| if b == 0.0 && a == 0.0 { 0.0 } else { b.atan2(a).rem_euclid(2.0 * PI) }; + let (h1p, h2p) = (hue(b1, a1p), hue(b2, a2p)); + let dl = l2 - l1; + let dc = c2p - c1p; + let dh = if c1p * c2p == 0.0 { + 0.0 + } else { + let d = h2p - h1p; + if d.abs() <= PI { + d + } else if d > PI { + d - 2.0 * PI + } else { + d + 2.0 * PI + } + }; + let dhh = 2.0 * (c1p * c2p).sqrt() * (dh / 2.0).sin(); + let l_bar = (l1 + l2) / 2.0; + let cp_bar = (c1p + c2p) / 2.0; + let hp_bar = if c1p * c2p == 0.0 { + h1p + h2p + } else if (h1p - h2p).abs() <= PI { + (h1p + h2p) / 2.0 + } else if h1p + h2p < 2.0 * PI { + (h1p + h2p + 2.0 * PI) / 2.0 + } else { + (h1p + h2p - 2.0 * PI) / 2.0 + }; + let t = 1.0 - 0.17 * (hp_bar - PI / 6.0).cos() + 0.24 * (2.0 * hp_bar).cos() + 0.32 * (3.0 * hp_bar + PI / 30.0).cos() + - 0.20 * (4.0 * hp_bar - 63.0 * PI / 180.0).cos(); + let d_theta = 30.0 * (-(((hp_bar * 180.0 / PI) - 275.0) / 25.0).powi(2)).exp(); + let rc = 2.0 * (cp_bar.powi(7) / (cp_bar.powi(7) + 25f64.powi(7))).sqrt(); + let sl = 1.0 + 0.015 * (l_bar - 50.0).powi(2) / (20.0 + (l_bar - 50.0).powi(2)).sqrt(); + let sc = 1.0 + 0.045 * cp_bar; + let sh = 1.0 + 0.015 * cp_bar * t; + let rt = -(2.0 * d_theta * PI / 180.0).sin() * rc; + ((dl / sl).powi(2) + (dc / sc).powi(2) + (dhh / sh).powi(2) + rt * (dc / sc) * (dhh / sh)).sqrt() +} + +#[test] +fn de2000_matches_the_published_test_pairs() { + // Sharma, Wu and Dalal (2005), table 1: pairs 1, 7 and 17 + let cases = [ + ([50.0, 2.6772, -79.7751], [50.0, 0.0, -82.7485], 2.0425), + ([50.0, 0.0, 0.0], [50.0, -1.0, 2.0], 2.3669), + ([50.0, 2.5, 0.0], [73.0, 25.0, -18.0], 27.1492), + ]; + for (a, b, e) in cases { + assert!((de2000(a, b) - e).abs() < 1e-3, "{a:?} {b:?}: {} vs {e}", de2000(a, b)); + } +} + +#[test] +fn the_d750_profile_develops_its_charts_close_to_lightroom() { + let set = set_dir(); + let dcp = set.join("profiles/20261016_NikonD750_DualIllumination_ColorCheckerPassport.dcp"); + let charts = [("daylight_flash", "raw/chart-daylight_flash.NEF"), ("indoor", "raw/chart-indoor.NEF")]; + let mut needed = vec![dcp.clone()]; + for (name, raw) in charts { + needed.push(set.join(raw)); + needed.push(set.join(format!("images/{name}-lightroom.jpg"))); + } + if let Some(missing) = needed.iter().find(|p| !p.exists()) { + lightcraft_testkit::skip!(Corpus, "{} absent (cargo xtask corpus --download)", missing.display()); + return; + } + let lib = std::env::temp_dir().join(format!("lc-dcp-d750-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&lib); + let mut s = Session::new().with_fs(); + s.open_library(&lib, false).unwrap(); + let r = s.execute("profile.import", &json!({"paths": [dcp.to_string_lossy()]})).unwrap(); + let dcp_id = r["imported"][0]["id"].as_str().expect("the D750 profile imports").to_string(); + assert!(r["imported"][0]["cameraModel"].as_str().unwrap().contains("D750"), "{r}"); + let o = ExportOptions::from_json(&json!({"format": "png", "longEdge": 1200, "colorSpace": "srgb"})); + let mut report = String::new(); + let mut means = Vec::new(); + for (name, raw) in charts { + let r = s.execute("library.import", &json!({"paths": [set.join(raw).to_string_lossy()]})).unwrap(); + let id = PhotoId(r["imported"][0].as_u64().expect("the NEF imports")); + s.execute("library.select", &json!({"ids": [id.0]})).unwrap(); + s.execute("develop.profile", &json!({"id": dcp_id})).unwrap(); + let centres = frame_centres(name); + let (reference, spread) = + patch_labs(&std::fs::read(set.join(format!("images/{name}-lightroom.jpg"))).unwrap(), &reference_centres(name), 0.02); + assert!(spread < 4.0, "{name}: every reference box lies inside its patch (L* spread {spread:.1})"); + // white balance on the second-lightest grey (patch 20), as the reference was made + let wb = s.execute("develop.wbPick", &json!({"x": centres[19].0, "y": centres[19].1})).unwrap(); + // exposure: the value whose grey row is closest to the reference's (golden-section search) + let render = |s: &mut Session, ev: f64| { + s.execute("develop.set", &json!({"control": "light.exposure", "value": ev})).unwrap(); + let e = export_photo(s, id, &o, 1).expect("the chart develops with the D750 profile"); + patch_labs(&e.bytes, ¢res, 0.006) + }; + let grey_de = |(labs, _): &(Vec<[f64; 3]>, f64)| (18..24).map(|i| de2000(labs[i], reference[i])).sum::() / 6.0; + let (mut lo, mut hi) = (-1.5f64, 1.5f64); + let phi = (5f64.sqrt() - 1.0) / 2.0; + let (mut m1, mut m2) = (hi - phi * (hi - lo), lo + phi * (hi - lo)); + let (mut f1, mut f2) = (grey_de(&render(&mut s, m1)), grey_de(&render(&mut s, m2))); + for _ in 0..8 { + if f1 < f2 { + (hi, m2, f2) = (m2, m1, f1); + m1 = hi - phi * (hi - lo); + f1 = grey_de(&render(&mut s, m1)); + } else { + (lo, m1, f1) = (m1, m2, f2); + m2 = lo + phi * (hi - lo); + f2 = grey_de(&render(&mut s, m2)); + } + } + let ev = (lo + hi) / 2.0; + let (ours, spread) = render(&mut s, ev); + assert!(spread < 4.0, "{name}: every box lies inside its patch (L* spread {spread:.1})"); + // LIGHTCRAFT_DCP_DUMP=: keep our renders, to check the patch boxes by eye + if let Some(dir) = std::env::var_os("LIGHTCRAFT_DCP_DUMP") { + s.execute("develop.set", &json!({"control": "light.exposure", "value": ev})).unwrap(); + let _ = std::fs::write(Path::new(&dir).join(format!("{name}.png")), export_photo(&mut s, id, &o, 1).unwrap().bytes); + } + let des: Vec = ours.iter().zip(&reference).map(|(a, b)| de2000(*a, *b)).collect(); + let mean = des.iter().sum::() / des.len() as f64; + let max = des.iter().cloned().fold(0.0, f64::max); + report += &format!("{name}: wb {} K / tint {}, exposure {ev:+.2}, mean ΔE2000 {mean:.2}, max {max:.2}\n", wb["temp"], wb["tint"]); + for (i, d) in des.iter().enumerate() { + report += &format!( + " patch {:2}: ΔE {d:5.2} ours L*a*b* {:6.1} {:6.1} {:6.1} Lightroom {:6.1} {:6.1} {:6.1}\n", + i + 1, + ours[i][0], + ours[i][1], + ours[i][2], + reference[i][0], + reference[i][1], + reference[i][2] + ); + } + means.push((name, mean, max)); + } + eprintln!("{report}"); + let _ = std::fs::remove_dir_all(&lib); + for (name, mean, max) in means { + assert!(mean < MEAN_LIMIT && max < MAX_LIMIT, "{name}: mean ΔE2000 {mean:.2}, max {max:.2}\n{report}"); + } +} diff --git a/crates/raw/tests/dcp_corpus.rs b/crates/raw/tests/dcp_corpus.rs new file mode 100644 index 00000000000..5f7a8e2ca9c --- /dev/null +++ b/crates/raw/tests/dcp_corpus.rs @@ -0,0 +1,148 @@ +//! A real camera profile: the Nikon D750 ColorChecker DCP dieli released under CC0 +//! (github.com/dieli/d750-lightcraft-colorchecker, pinned in `D750_COLORCHECKER`, xtask/src/main.rs; +//! `cargo xtask corpus --download` puts it in the gitignored `corpus/d750-colorchecker/`). +//! +//! Calibrite PROFILER made it from two chart shots: a dual-illuminant, matrix-only profile +//! (`ColorMatrix1/2` for Cool White Fluorescent and D55; no `ForwardMatrix`, hue/saturation map, +//! look table or tone curve). The tests check that it parses as such, that the matrices blend between +//! the two illuminants by the white's inverse temperature, that the matrix-only path (no forward +//! matrix) gives a usable camera transform, and that it develops the chart NEFs it was made from. +//! Missing files are reported as skipped. + +use lightcraft_color::{Xy, cct}; +use lightcraft_raw::color::{camera_to_xyz_d50, camera_transform_of, illuminant_weight, xyz_to_camera}; +use lightcraft_raw::dcp::{DcpProfile, parse_dcp, write_dcp}; +use lightcraft_raw::{Mat3, decode}; +use std::path::{Path, PathBuf}; + +const PROFILE: &str = "profiles/20261016_NikonD750_DualIllumination_ColorCheckerPassport.dcp"; +const CHARTS: [&str; 2] = ["raw/chart-daylight_flash.NEF", "raw/chart-indoor.NEF"]; + +fn set_dir() -> PathBuf { + std::env::var_os("LIGHTCRAFT_CORPUS") + .map(PathBuf::from) + .unwrap_or_else(|| Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus")) + .join("d750-colorchecker") +} + +fn read(rel: &str) -> Option> { + let path = set_dir().join(rel); + let bytes = std::fs::read(&path).ok(); + if bytes.is_none() { + lightcraft_testkit::skip!(Corpus, "{} absent (cargo xtask corpus --download)", path.display()); + } + bytes +} + +fn profile() -> Option { + read(PROFILE).map(|b| parse_dcp(&b).expect("the D750 profile parses")) +} + +fn max_diff(a: &Mat3, b: &Mat3) -> f64 { + a.0.iter().flatten().zip(b.0.iter().flatten()).map(|(x, y)| (x - y).abs()).fold(0.0, f64::max) +} + +#[test] +fn the_d750_profile_parses_as_a_dual_illuminant_matrix_only_profile() { + let Some(p) = profile() else { return }; + assert!(p.camera_model.contains("D750"), "camera {:?}", p.camera_model); + // CalibrationIlluminant1/2: Cool White Fluorescent (14) and D55 (20) + assert_eq!(p.color.illuminant, [14, 20]); + let [Some(cm1), Some(cm2)] = p.color.color_matrix else { panic!("two colour matrices: {:?}", p.color.color_matrix) }; + assert!(max_diff(&cm1, &cm2) > 1e-3, "the two illuminants have their own matrices"); + for m in [cm1, cm2] { + assert!(m.0.iter().flatten().all(|v| v.is_finite() && v.abs() < 10.0), "{m:?}"); + assert!(m.inverse().is_some(), "invertible: {m:?}"); + } + assert_eq!(p.color.forward_matrix, [None, None], "matrix-only: no forward matrix"); + assert!(p.color.profile.hue_sat_map.iter().all(Option::is_none), "no hue/saturation map"); + assert!(p.color.profile.look_table.is_none(), "no look table"); + // nothing of a particular shot + assert_eq!((p.color.as_shot_neutral, p.color.analog_balance), (None, None)); + // our writer keeps what matters of it + let again = parse_dcp(&write_dcp(&p).unwrap()).unwrap(); + assert_eq!((again.name.as_str(), again.camera_model.as_str(), again.color.illuminant), (p.name.as_str(), p.camera_model.as_str(), [14, 20])); + for i in 0..2 { + assert!(max_diff(&again.color.color_matrix[i].unwrap(), &p.color.color_matrix[i].unwrap()) < 1e-6); + } +} + +#[test] +fn the_d750_matrices_blend_by_inverse_temperature_between_the_two_illuminants() { + let Some(p) = profile() else { return }; + let c = &p.color; + let [Some(cm1), Some(cm2)] = c.color_matrix else { panic!("two colour matrices") }; + let at = |k: f64| cct::temp_tint_to_xy(k, 0.0); + // at and beyond each calibration illuminant (4150 K / 5503 K) only its own matrix + for k in [2800.0, 4150.0] { + assert!((illuminant_weight(c, at(k)) - 1.0).abs() < 0.02, "{k} K: {}", illuminant_weight(c, at(k))); + assert!(max_diff(&xyz_to_camera(c, at(k)), &cm1) < 0.02 * 3.0, "{k} K takes ColorMatrix1"); + } + for k in [5503.0, 7500.0] { + assert!(illuminant_weight(c, at(k)).abs() < 0.02, "{k} K: {}", illuminant_weight(c, at(k))); + assert!(max_diff(&xyz_to_camera(c, at(k)), &cm2) < 0.02 * 3.0, "{k} K takes ColorMatrix2"); + } + // in between: the DNG weighting (1/T − 1/T2) / (1/T1 − 1/T2), and the matrix is that blend + let k = 4800.0; + let w = illuminant_weight(c, at(k)); + let t = cct::xy_to_temp_tint(at(k)).0; + let expected = (1.0 / t - 1.0 / 5503.0) / (1.0 / 4150.0 - 1.0 / 5503.0); + assert!((w - expected).abs() < 1e-6 && w > 0.2 && w < 0.8, "weight {w}, expected {expected}"); + let mut blend = [[0.0; 3]; 3]; + for (i, row) in blend.iter_mut().enumerate() { + for (j, v) in row.iter_mut().enumerate() { + *v = w * cm1.0[i][j] + (1.0 - w) * cm2.0[i][j]; + } + } + assert!(max_diff(&xyz_to_camera(c, at(k)), &Mat3(blend)) < 1e-9); + // weights fall monotonically with temperature + let ws: Vec = [3000.0, 4300.0, 4600.0, 5000.0, 5400.0, 6500.0].iter().map(|k| illuminant_weight(c, at(*k))).collect(); + assert!(ws.windows(2).all(|p| p[0] >= p[1]), "{ws:?}"); +} + +#[test] +fn the_matrix_only_path_inverts_the_colour_matrix_and_adapts_to_d50() { + let Some(p) = profile() else { return }; + let c = &p.color; + for k in [3200.0, 4500.0, 5500.0, 6500.0] { + let white: Xy = cct::temp_tint_to_xy(k, 0.0); + let to_d50 = camera_to_xyz_d50(c, white); + let expected = lightcraft_color::bradford(white, lightcraft_color::D50).mul(&xyz_to_camera(c, white).inverse().unwrap()); + assert!(max_diff(&to_d50, &expected) < 1e-9, "{k} K: no forward matrix, so XYZtoCamera⁻¹ then Bradford"); + // the camera's neutral under that white lands on D50 + let n = xyz_to_camera(c, white).apply(white.to_xyz()); + let xyz = to_d50.apply(n); + let xy = Xy::from_xyz(xyz); + assert!((xy.x - lightcraft_color::D50.x).abs() < 1e-6 && (xy.y - lightcraft_color::D50.y).abs() < 1e-6, "{k} K → {xy:?}"); + // the transform the pipeline uses maps white-balanced (1, 1, 1) to white + let t = camera_transform_of(c, white); + assert!(!t.matrix_is_fallback); + let w = t.matrix.apply([1.0; 3]); + assert!(w.iter().all(|v| (v - 1.0).abs() < 1e-6), "{k} K: {w:?}"); + assert!(t.wb.iter().all(|v| v.is_finite() && *v >= 1.0 && *v < 8.0), "{k} K: {:?}", t.wb); + } +} + +#[test] +fn the_d750_profile_takes_over_the_chart_nefs_colour() { + let Some(p) = profile() else { return }; + let mut whites = Vec::new(); + for chart in CHARTS { + let Some(bytes) = read(chart) else { return }; + let raw = decode(&bytes).expect("the D750 NEF decodes"); + let color = p.applied_to(&raw.color); + assert_eq!(color.color_matrix, p.color.color_matrix, "{chart}: the profile's matrices"); + assert_eq!(color.forward_matrix, [None, None]); + // the camera's own white balance stays and reads as a white under the profile's matrices + let mut with = raw.clone(); + with.color = color; + let white = lightcraft_raw::color::as_shot_white_xy(&with); + let (k, tint) = cct::xy_to_temp_tint(white); + assert!((2000.0..9000.0).contains(&k) && tint.abs() < 60.0, "{chart}: as-shot {k:.0} K, tint {tint:.1}"); + let t = lightcraft_raw::color::camera_transform(&with, white); + assert!(t.matrix.0.iter().flatten().all(|v| v.is_finite()), "{chart}: {t:?}"); + whites.push(k); + } + // the flash shot is the cooler light's opposite: warmer light indoors reads as a lower temperature + assert!(whites[0] > whites[1] + 300.0, "flash {:.0} K vs indoor {:.0} K", whites[0], whites[1]); +} diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 77c704c928a..e360a1df946 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -1,6 +1,6 @@ # Lightroom parity checklist -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-15 · **Change:** minor (LRC-PRINT-PAGE: Print Page Options; LR-PROF-IMPORT: the user's own .dcp camera profiles import) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-22 · **Change:** minor (LR-PROF-IMPORT: the user's own .dcp camera profiles import, checked on a real D750 profile against Lightroom; LRC-PRINT-PAGE: Print Page Options) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 The measured, row-by-row checklist: one row per Lightroom feature, menu item and shortcut, what we have and what is missing. It answers *does the feature exist?* (feature breadth). Whether it is good @@ -243,7 +243,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts). | LR-PROF-LEGACY | Legacy profiles | P2 | ⬜ | | | | LR-PROF-NONRAW | Profiles for non-raw files | P0 | ✅ | `cmd:develop.profile` | same looks apply to JPEG/TIFF | | LR-PROF-AMOUNT | Profile amount | P1 | ✅ | `ctl:profile.amount` | | -| LR-PROF-IMPORT | Import profiles | P1 | ✅ | `cmd:profile.import`, `cmd:profile.deleteImported`, `crates/pipeline/src/lut.rs`, `crates/engine/src/cmd/lut_profiles.rs`, `cmd:profiles.camera`, `cmd:profile.deleteCamera`, `crates/engine/src/cmd/dcp_profiles.rs`, `crates/raw/src/dcp.rs`, `crates/ui-egui/src/panels/edit.rs`, `crates/ui-egui/src/panels/profiles.rs` | `.cube` 3D LUTs (files, folders, zips) become creative profiles with Amount, grouped in the profile browser, kept with the library; rendered on the CPU; the user's own DNG camera profiles (`.dcp`: matrices, illuminants, hue/sat map, look table, tone curve) become camera profiles (`dcp:` ids, group Camera Profiles) that replace a raw file's colour model when it is decoded (a profile without a tone curve keeps the photo's own contrast; the photo is decoded again when the profile changes; smart previews and the web worker keep the file's own colour); none ship with the app; XMP camera/creative profiles unsupported | +| LR-PROF-IMPORT | Import profiles | P1 | ✅ | `cmd:profile.import`, `cmd:profile.deleteImported`, `crates/pipeline/src/lut.rs`, `crates/engine/src/cmd/lut_profiles.rs`, `cmd:profiles.camera`, `cmd:profile.deleteCamera`, `crates/engine/src/cmd/dcp_profiles.rs`, `crates/raw/src/dcp.rs`, `crates/ui-egui/src/panels/edit.rs`, `crates/ui-egui/src/panels/profiles.rs` | `.cube` 3D LUTs (files, folders, zips) become creative profiles with Amount, grouped in the profile browser, kept with the library; rendered on the CPU; the user's own DNG camera profiles (`.dcp`: matrices, illuminants, hue/sat map, look table, tone curve) become camera profiles (`dcp:` ids, group Camera Profiles) that replace a raw file's colour model when it is decoded (a profile without a tone curve keeps the photo's own contrast; the photo is decoded again when the profile changes; smart previews and the web worker keep the file's own colour); none ship with the app; XMP camera/creative profiles unsupported. Checked on a real profile: a CC0 Calibrite PROFILER profile for the Nikon D750 (matrix-only, Cool White Fluorescent + D55; `cargo xtask corpus --download`, never committed) develops its two chart NEFs within mean ΔE2000 3.8 (flash) and 3.4 (indoor) of Lightroom Classic 15.6 with the same profile, max 7.8 (`crates/engine/src/tests_dcp_corpus.rs`, `crates/raw/tests/dcp_corpus.rs`) | ## H. Crop & rotate (CROP) @@ -801,6 +801,7 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove | 2026-10-15 | minor | LRC-PRINT-PAGE: Page Options (Page Numbers, Page Info, Crop Marks) on Single Image and Contact Sheet pages, in the Print dialog, `print.set` and templates; still 🟡 (no identity plate, watermark, photo info or Cut Guides) | | 2026-10-15 | minor | LR-IMP-FORMATS: Hasselblad 3FR and FFF show their uncompressed RGB preview (no JPEG in these files) in the grid and loupe until developed, and as the stand-in when a file fails to decode; status unchanged (🟡) | | 2026-10-15 | minor | LR-IMP-FORMATS: a Hasselblad FFF develops with the camera's colour matrix from the original 3FR header it embeds (tag `0xC51B`) instead of the neutral matrix; status unchanged (🟡) | +| 2026-10-22 | patch | LR-PROF-IMPORT: a real CC0 D750 profile (matrix-only, dual illuminant) and its chart NEFs are a pinned test corpus; against Lightroom Classic 15.6 mean ΔE2000 3.8 / 3.4; status unchanged (✅) | | 2026-10-12 | minor | LR-PROF-IMPORT: the user's own DNG camera profiles (`.dcp`) import as camera profiles; none ship | | 2026-10-12 | minor | LR-EDIT-OPTICS-PROFILE: Sony ARW shading, CA and distortion tables decoded with settings and provenance (raw IFD, `SR2SubIFD` fallback); applied corrections unchanged (ILCE-7RM4A and ILCE-7RM6 distortion); status unchanged (🟡) | | 2026-10-14 | minor | LR-IMP-CAMERA-COVERAGE: Camera-coverage sweep (#1327): 30 models verified on 40 CC0 files (coverage.py 515 → 545 verified); sensor verification does not establish colour parity (#1277); status unchanged (🟡) | diff --git a/docs/raw-parity.md b/docs/raw-parity.md index dff4ad27641..cef5fd0a447 100644 --- a/docs/raw-parity.md +++ b/docs/raw-parity.md @@ -1,6 +1,6 @@ # RAW parity: cameras, formats, demosaic, colour and lens profiles -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (X-Trans CMOS 4 bodies take the X-T3's spectral matrices; LR-PROF-IMPORT: the user's own `.dcp` camera profiles import) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 (Camera Raw 18.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-22 · **Change:** minor (LR-PROF-IMPORT: the user's own `.dcp` camera profiles import, checked on a real D750 profile; X-Trans CMOS 4 bodies take the X-T3's spectral matrices) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 (Camera Raw 18.7) Raw processing is the deepest single dimension of Lightroom parity: a photographer whose camera does not decode, or decodes with the wrong colour, cannot switch. This document measures it model by @@ -208,7 +208,7 @@ sample files. A pointer for contributors, not legal advice. | Default profile per model | Adobe Standard for every model (1,500 profile names in the bundle) | the DNG's own matrices; else a pooled profile (**5 bundled**: ILCA-99M2, ILCE-7CR, ILCE-7M4, X-H2S, X-T4); else a guarded per-file fit to the camera's embedded JPEG; else spectral matrices (**52 models**, rawtoaces-data, and the bodies sharing their sensors: 6 X-Trans CMOS 4 Fujifilm bodies take the X-T3's); else a neutral matrix | | Camera Matching looks | 481 models (plus phone-maker looks) | none (the per-file JPEG fit imitates the camera's own look) | | Creative profiles | Adobe Color, Portrait, Landscape, Vivid, Monochrome… | our own looks (Color, Neutral, Vivid, Landscape, Portrait, Monochrome) | -| DCP / dual-illuminant model | ✅ | dual-illuminant DNG colour (ColorMatrix / ForwardMatrix 1-2, CameraCalibration, AnalogBalance), HueSatMap, LookTable, ProfileToneCurve; the user's own `.dcp` files can be imported as camera profiles (`crates/raw/src/dcp.rs`), none ship with the app (clean-room) | +| DCP / dual-illuminant model | ✅ | dual-illuminant DNG colour (ColorMatrix / ForwardMatrix 1-2, CameraCalibration, AnalogBalance), HueSatMap, LookTable, ProfileToneCurve; the user's own `.dcp` files can be imported as camera profiles (`crates/raw/src/dcp.rs`), none ship with the app (clean-room); a CC0 D750 chart profile develops its charts within mean ΔE2000 3.8 / 3.4 of Lightroom with the same profile | | White balance in Kelvin | ✅ for every model | absolute Kelvin where the camera has colour matrices (its own, or one of the 52 spectral rows), also for files whose look is a per-file fit (#730), or where Sony's white-balance presets in the file give the scale (6 bodies, `kelvin_presets`); other raws keep the relative scale (#296) | **How far the default rendering is from Adobe's** (CIE ΔE; measured where stated): @@ -290,6 +290,7 @@ Beyond decoding: | 2026-10-18 | patch | X-T30, X-T30 II, X-Pro3, X100V, X-S10 and X-E4 take the X-T3's spectral matrices (same 26.1 MP X-Trans CMOS 4 sensor): an X-T30 raw with a black-and-white (Acros) camera JPEG no longer opens in the muted neutral fallback | | 2026-10-15 | minor | Hasselblad 3FR / FFF embedded previews: the uncompressed 8-bit RGB image, handed on as a baseline TIFF (checked on the CC0 H4D-40 FFF, 1217 × 913, and CFV 3FR, 218 × 218, upright through the file's orientation); counts unchanged | | 2026-10-15 | minor | Hasselblad 3FR / FFF get their own reader (`crates/raw/src/vendor/hasselblad.rs`): an FFF takes its colour matrix from the original 3FR header in tag `0xC51B` instead of developing with the neutral matrix; RGGB checked against the camera preview on the CC0 H4D-40 FFF and CFV 3FR; counts unchanged | +| 2026-10-22 | patch | LR-PROF-IMPORT: a CC0 Nikon D750 ColorChecker profile (Calibrite PROFILER, matrix-only, Cool White Fluorescent + D55) and its chart NEFs are a pinned corpus (`D750_COLORCHECKER`); with it LightCraft develops the charts within mean ΔE2000 3.84 (flash) / 3.35 (indoor), max 7.77 / 5.24, of Lightroom Classic 15.6's renders; colour patches come out less saturated | | 2026-10-12 | minor | LR-PROF-IMPORT: the user's own DNG camera profiles (`.dcp`) import as camera profiles; none ship | | 2026-10-14 | minor | Camera-coverage sweep (#1327): 30 models verified on 40 CC0 files (`coverage_sweep_corpus.rs`, `coverage-sweep.tsv`; `docs/raw/coverage.py` 515 → 545 verified rows); the counts above are not re-measured here. Sensor verification does not establish colour parity (#1277) | | 2026-10-13 | minor | Bundled camera profiles 4 → 5 (ILCA-99M2) | diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 8a7d597b50a..f9f543b3c18 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -2713,6 +2713,39 @@ const RAW_SAMPLES: &[(&str, &str, &str)] = &[ ), ]; +/// A Nikon D750 ColorChecker set released under CC0 by dieli (github.com/dieli/d750-lightcraft-colorchecker), +/// pinned to one commit: a matrix-only dual-illuminant DNG camera profile (Cool White Fluorescent + D55) +/// made with Calibrite PROFILER from the two chart shots, the chart NEFs, and Lightroom Classic 15.6's +/// renders of them with that profile. Downloaded into `corpus/d750-colorchecker/` (the repository's own +/// layout) for the `.dcp` import tests; never committed. Fields: path, URL, SHA-256. +const D750_COLORCHECKER: &[(&str, &str, &str)] = &[ + ( + "raw/chart-daylight_flash.NEF", + "https://raw.githubusercontent.com/dieli/d750-lightcraft-colorchecker/f37f4054b62fa7fb02f35ab8b7ce508f2196459d/raw/chart-daylight_flash.NEF", + "ebb6768ca1a82e3dc8b455e03842245a8e0d067045f720fbf2dcf20b90f06624", + ), + ( + "raw/chart-indoor.NEF", + "https://raw.githubusercontent.com/dieli/d750-lightcraft-colorchecker/f37f4054b62fa7fb02f35ab8b7ce508f2196459d/raw/chart-indoor.NEF", + "d687c3efd25697208bdd1015856f30d00f1c4d768237c936640b61997b6d713a", + ), + ( + "profiles/20261016_NikonD750_DualIllumination_ColorCheckerPassport.dcp", + "https://raw.githubusercontent.com/dieli/d750-lightcraft-colorchecker/f37f4054b62fa7fb02f35ab8b7ce508f2196459d/profiles/20261016_NikonD750_DualIllumination_ColorCheckerPassport.dcp", + "eb7e9465a42099628ffe61838ae4626a4bb51982492975076808c54ebf8d3d78", + ), + ( + "images/daylight_flash-lightroom.jpg", + "https://raw.githubusercontent.com/dieli/d750-lightcraft-colorchecker/f37f4054b62fa7fb02f35ab8b7ce508f2196459d/images/daylight_flash-lightroom.jpg", + "725ee289efb6edcbbb792a41df5c74df5c865d9e31e55811453a43ddfc5c7bb0", + ), + ( + "images/indoor-lightroom.jpg", + "https://raw.githubusercontent.com/dieli/d750-lightcraft-colorchecker/f37f4054b62fa7fb02f35ab8b7ce508f2196459d/images/indoor-lightroom.jpg", + "213580e9b0d8e2a76c29aa2eaa9884b724e9b605df2b723ac51af975ec84c414", + ), +]; + fn cmd_corpus(download: bool) -> Result<(), String> { let corpus = root().join("corpus"); println!( @@ -2721,17 +2754,38 @@ Tests that use a corpus skip cleanly when it is absent. corpus/raw/ raw.pixls.us samples (CC0) — lightcraft-raw decodes every file. corpus/images/ CC0 / public-domain JPEG/PNG/TIFF/HEIC samples (optional) + corpus/d750-colorchecker/ Nikon D750 ColorChecker set (CC0, dieli): a .dcp, chart NEFs, Lightroom renders ", corpus.display() ); if !download { return Ok(()); } - let dest = corpus.join("raw"); - std::fs::create_dir_all(&dest).map_err(|e| format!("create {}: {e}", dest.display()))?; let mut bad = Vec::new(); - for (name, url, sha256) in RAW_SAMPLES { + fetch_pinned(&corpus.join("raw"), RAW_SAMPLES, &mut bad)?; + fetch_pinned(&corpus.join("d750-colorchecker"), D750_COLORCHECKER, &mut bad)?; + if bad.is_empty() { + return Ok(()); + } + Err(format!( + "{} corpus file(s) do not match their pinned sha256: + {}", + bad.len(), + bad.join( + " + " + ) + )) +} + +/// Download each `(path, url, sha256)` of `files` under `dest` unless present, and check its SHA-256 +/// (a mismatch is deleted, so the next run downloads it again, and reported in `bad`). +fn fetch_pinned(dest: &Path, files: &[(&str, &str, &str)], bad: &mut Vec) -> Result<(), String> { + for (name, url, sha256) in files { let out = dest.join(name); + if let Some(dir) = out.parent() { + std::fs::create_dir_all(dir).map_err(|e| format!("create {}: {e}", dir.display()))?; + } if !out.exists() { let mut curl = Command::new("curl"); curl.args(["-fsSL", "-o"]).arg(&out).arg(url); @@ -2744,18 +2798,7 @@ Tests that use a corpus skip cleanly when it is absent. bad.push(format!("{name}: sha256 is {actual}, expected {sha256} (file deleted; source {url})")); } } - if bad.is_empty() { - return Ok(()); - } - Err(format!( - "{} corpus file(s) do not match their pinned sha256: - {}", - bad.len(), - bad.join( - " - " - ) - )) + Ok(()) } fn file_sha256(path: &Path) -> Result { @@ -2785,16 +2828,25 @@ mod ci_jobs_tests { #[cfg(test)] mod corpus_tests { - use super::RAW_SAMPLES; + use super::{D750_COLORCHECKER, RAW_SAMPLES}; #[test] fn every_sample_has_a_unique_name_and_a_sha256() { - let mut names: Vec<_> = RAW_SAMPLES.iter().map(|s| s.0).collect(); - names.sort_unstable(); - names.dedup(); - assert_eq!(names.len(), RAW_SAMPLES.len(), "duplicate file name"); - for (name, _, sha256) in RAW_SAMPLES { - assert!(sha256.len() == 64 && sha256.bytes().all(|b| matches!(b, b'0'..=b'9' | b'a'..=b'f')), "{name}: not a lowercase sha256"); + for set in [RAW_SAMPLES, D750_COLORCHECKER] { + let mut names: Vec<_> = set.iter().map(|s| s.0).collect(); + names.sort_unstable(); + names.dedup(); + assert_eq!(names.len(), set.len(), "duplicate file name"); + for (name, _, sha256) in set { + assert!(sha256.len() == 64 && sha256.bytes().all(|b| matches!(b, b'0'..=b'9' | b'a'..=b'f')), "{name}: not a lowercase sha256"); + } + } + } + + #[test] + fn the_d750_set_is_pinned_to_one_commit() { + for (name, url, _) in D750_COLORCHECKER { + assert!(url.contains("/f37f4054b62fa7fb02f35ab8b7ce508f2196459d/") && url.ends_with(name), "{name}: {url}"); } } } From 0d17a38e890ac684c92d85b1be82e9f5ca69c9bf Mon Sep 17 00:00:00 2001 From: OneSlips Date: Fri, 16 Oct 2026 05:09:35 +1000 Subject: [PATCH 10/27] LR-PROF-IMPORT: a single .dcp file is a camera profile only, not also an unreadable LUT profile.import read every plain file that was neither a folder nor a .zip as a .cube LUT, so importing one .dcp imported the camera profile and also reported it as failed ("stream did not contain valid UTF-8"). Only .cube files are read as LUTs now. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/lut_profiles.rs | 3 ++- crates/engine/src/tests_dcp.rs | 2 ++ docs/parity-checklist.md | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/cmd/lut_profiles.rs b/crates/engine/src/cmd/lut_profiles.rs index bf5c1e7cc81..cf4b22bd117 100644 --- a/crates/engine/src/cmd/lut_profiles.rs +++ b/crates/engine/src/cmd/lut_profiles.rs @@ -77,12 +77,13 @@ fn cube_files(paths: &[String]) -> (Vec<(String, String, Option)>, Vec out.push((stem(path), t, None)), Err(e) => failed.push(json!([stem(path), e.to_string()])), } } + // (a .dcp is a camera profile: `dcp_profiles::import_files` takes it) } (out, failed) } diff --git a/crates/engine/src/tests_dcp.rs b/crates/engine/src/tests_dcp.rs index d850105ed10..2bbb2cec717 100644 --- a/crates/engine/src/tests_dcp.rs +++ b/crates/engine/src/tests_dcp.rs @@ -97,6 +97,8 @@ fn import_choose_cache_persist_and_delete() { // importing it again adds nothing let again = s.execute("profile.import", &json!({"paths": [files.join("profiles").join("Swap.dcp").to_string_lossy()]})).unwrap(); assert_eq!(again["imported"][0]["existing"], true); + // a single .dcp file is a camera profile only, not also a LUT that "couldn't be read" + assert_eq!(again["failed"], json!([]), "{again}"); assert_eq!(s.dcp_profiles.len(), 1); // the library keeps its own copy assert!(std::path::Path::new(&s.dcp_profiles[0].file).starts_with(&lib)); diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index e360a1df946..72d51993ad0 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -243,7 +243,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts). | LR-PROF-LEGACY | Legacy profiles | P2 | ⬜ | | | | LR-PROF-NONRAW | Profiles for non-raw files | P0 | ✅ | `cmd:develop.profile` | same looks apply to JPEG/TIFF | | LR-PROF-AMOUNT | Profile amount | P1 | ✅ | `ctl:profile.amount` | | -| LR-PROF-IMPORT | Import profiles | P1 | ✅ | `cmd:profile.import`, `cmd:profile.deleteImported`, `crates/pipeline/src/lut.rs`, `crates/engine/src/cmd/lut_profiles.rs`, `cmd:profiles.camera`, `cmd:profile.deleteCamera`, `crates/engine/src/cmd/dcp_profiles.rs`, `crates/raw/src/dcp.rs`, `crates/ui-egui/src/panels/edit.rs`, `crates/ui-egui/src/panels/profiles.rs` | `.cube` 3D LUTs (files, folders, zips) become creative profiles with Amount, grouped in the profile browser, kept with the library; rendered on the CPU; the user's own DNG camera profiles (`.dcp`: matrices, illuminants, hue/sat map, look table, tone curve) become camera profiles (`dcp:` ids, group Camera Profiles) that replace a raw file's colour model when it is decoded (a profile without a tone curve keeps the photo's own contrast; the photo is decoded again when the profile changes; smart previews and the web worker keep the file's own colour); none ship with the app; XMP camera/creative profiles unsupported. Checked on a real profile: a CC0 Calibrite PROFILER profile for the Nikon D750 (matrix-only, Cool White Fluorescent + D55; `cargo xtask corpus --download`, never committed) develops its two chart NEFs within mean ΔE2000 3.8 (flash) and 3.4 (indoor) of Lightroom Classic 15.6 with the same profile, max 7.8 (`crates/engine/src/tests_dcp_corpus.rs`, `crates/raw/tests/dcp_corpus.rs`) | +| LR-PROF-IMPORT | Import profiles | P1 | ✅ | `cmd:profile.import`, `cmd:profile.deleteImported`, `crates/pipeline/src/lut.rs`, `crates/engine/src/cmd/lut_profiles.rs`, `cmd:profiles.camera`, `cmd:profile.deleteCamera`, `crates/engine/src/cmd/dcp_profiles.rs`, `crates/raw/src/dcp.rs`, `crates/ui-egui/src/panels/edit.rs`, `crates/ui-egui/src/panels/profiles.rs` | `.cube` 3D LUTs (files, folders, zips) become creative profiles with Amount, grouped in the profile browser, kept with the library; rendered on the CPU; the user's own DNG camera profiles (`.dcp`: matrices, illuminants, hue/sat map, look table, tone curve) become camera profiles (`dcp:` ids, group Camera Profiles) that replace a raw file's colour model when it is decoded (a profile without a tone curve keeps the photo's own contrast; the photo is decoded again when the profile changes; smart previews and the web worker keep the file's own colour); none ship with the app; XMP camera/creative profiles unsupported; a single `.dcp` is not also reported as an unreadable LUT. Checked on a real profile: a CC0 Calibrite PROFILER profile for the Nikon D750 (matrix-only, Cool White Fluorescent + D55; `cargo xtask corpus --download`, never committed) develops its two chart NEFs within mean ΔE2000 3.8 (flash) and 3.4 (indoor) of Lightroom Classic 15.6 with the same profile, max 7.8 (`crates/engine/src/tests_dcp_corpus.rs`, `crates/raw/tests/dcp_corpus.rs`) | ## H. Crop & rotate (CROP) From af38d046b067d9d80e7c201a2e58570612251d2b Mon Sep 17 00:00:00 2001 From: OneSlips Date: Fri, 23 Oct 2026 23:25:35 +1000 Subject: [PATCH 11/27] LR-PROF-IMPORT: review fixes for imported camera profiles - A library moved or restored elsewhere finds its camera profiles in its own Profiles/ folder. - A grid thumbnail is cut from the decoded preview only when that preview used the same camera profile. - Render and source cache keys carry a fingerprint of the profile file, so a deleted or replaced profile never has its old renders stand in. - Camera profiles can be favourites, and favourites/recent entries survive reopening the library. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/dcp_profiles.rs | 33 ++++++-- crates/engine/src/cmd/develop.rs | 2 +- crates/engine/src/library.rs | 8 +- crates/engine/src/media.rs | 87 +++++++++++++++----- crates/engine/src/tests_dcp.rs | 113 +++++++++++++++++++++++++- 5 files changed, 210 insertions(+), 33 deletions(-) diff --git a/crates/engine/src/cmd/dcp_profiles.rs b/crates/engine/src/cmd/dcp_profiles.rs index a6038480381..4bc43113e0d 100644 --- a/crates/engine/src/cmd/dcp_profiles.rs +++ b/crates/engine/src/cmd/dcp_profiles.rs @@ -8,12 +8,11 @@ //! library's prefs and the profiles are parsed again when the library opens. use std::path::{Path, PathBuf}; -use std::sync::Arc; -use lightcraft_raw::dcp::DcpProfile; use serde_json::{Value, json}; use super::{CommandSpec, always, bad, cmd, str_param}; +use crate::media::LoadedCameraProfile; use crate::{Result, Session}; /// Profile id prefix of imported camera profiles. @@ -47,15 +46,34 @@ fn profiles_dir(s: &Session) -> Option { /// Parse every imported camera profile again and hand them to the decoder (missing or damaged /// files are skipped: photos using them develop with the file's own colour). -pub fn register_all(s: &mut Session) { - let loaded: Vec<(String, Arc)> = s +/// +/// A library's own copies are found in `profiles`, the `Profiles/` folder of the library being opened (`None`: not on +/// disk), wherever the saved path points: a library moved or restored elsewhere keeps its profiles (the saved path is +/// updated). +pub fn register_all(s: &mut Session, profiles: Option<&Path>) { + if let Some(dir) = profiles { + for p in &mut s.dcp_profiles { + if let Some(here) = library_copy(dir, &p.file) { + p.file = here.to_string_lossy().to_string(); + } + } + } + let loaded: Vec<(String, LoadedCameraProfile)> = s .dcp_profiles .iter() - .filter_map(|p| std::fs::read(&p.file).ok().and_then(|b| lightcraft_raw::dcp::parse_dcp(&b).ok()).map(|d| (p.id.clone(), Arc::new(d)))) + .filter_map(|p| std::fs::read(&p.file).ok().and_then(|b| LoadedCameraProfile::parse(&b).ok()).map(|d| (p.id.clone(), d))) .collect(); s.media.camera_profiles = loaded.into_iter().collect(); } +/// The copy of saved profile file `file` in the open library's profiles folder `dir`, when it is there under the +/// same name and `file` is not already it. +fn library_copy(dir: &Path, file: &str) -> Option { + let saved = Path::new(file); + let here = dir.join(saved.file_name()?); + (here != saved && here.is_file()).then_some(here) +} + /// `.dcp` files under `paths` (folders searched). pub fn dcp_files(paths: &[String]) -> Vec { let is_dcp = |f: &Path| f.extension().is_some_and(|x| x.eq_ignore_ascii_case("dcp")); @@ -89,13 +107,14 @@ pub fn import_files(s: &mut Session, paths: &[String]) -> Result<(Vec, Ve continue; } }; - let profile = match lightcraft_raw::dcp::parse_dcp(&bytes) { + let loaded = match LoadedCameraProfile::parse(&bytes) { Ok(p) => p, Err(e) => { failed.push(json!([shown, e.to_string()])); continue; } }; + let profile = loaded.profile.clone(); let stem = f.file_stem().map(|n| n.to_string_lossy().to_string()).unwrap_or_else(|| "Camera Profile".into()); let name = if profile.name.trim().is_empty() { stem.clone() } else { profile.name.trim().to_string() }; // the same profile imported again: keep the one there is @@ -124,7 +143,7 @@ pub fn import_files(s: &mut Session, paths: &[String]) -> Result<(Vec, Ve // no library on disk: remember the original (the in-memory session ends with the app) None => f.to_string_lossy().to_string(), }; - s.media.camera_profiles.insert(id.clone(), Arc::new(profile.clone())); + s.media.camera_profiles.insert(id.clone(), loaded); s.dcp_profiles.push(DcpEntry { id: id.clone(), name: name.clone(), camera_model: profile.camera_model.clone(), file }); imported.push(json!({"id": id, "name": name, "cameraModel": profile.camera_model})); } diff --git a/crates/engine/src/cmd/develop.rs b/crates/engine/src/cmd/develop.rs index b3a51049191..f37d4ba0ac6 100644 --- a/crates/engine/src/cmd/develop.rs +++ b/crates/engine/src/cmd/develop.rs @@ -497,7 +497,7 @@ pub fn specs() -> Vec { }), cmd!("profile.favorite", "Favorite Profile", [], None, "{id, favorite?: bool} (toggles when omitted)", always, |s, p| { let id = str_param(p, "id").ok_or_else(|| bad("profile.favorite", "missing id"))?.to_string(); - if crate::presets::profile(&id).is_none() && !s.lut_profiles.iter().any(|x| x.id == id) { + if crate::presets::profile(&id).is_none() && !s.lut_profiles.iter().any(|x| x.id == id) && !s.dcp_profiles.iter().any(|x| x.id == id) { return Err(bad("profile.favorite", format!("unknown profile `{id}`"))); } let on = s.profile_favorites.contains(&id); diff --git a/crates/engine/src/library.rs b/crates/engine/src/library.rs index f5fb62d8357..9859757bea1 100644 --- a/crates/engine/src/library.rs +++ b/crates/engine/src/library.rs @@ -511,7 +511,7 @@ impl Session { self.lut_profiles = prefs.lut_profiles; crate::cmd::lut_profiles::register_all(self); self.dcp_profiles = prefs.dcp_profiles; - crate::cmd::dcp_profiles::register_all(self); + crate::cmd::dcp_profiles::register_all(self, on_disk.then(|| dir.join("Profiles")).as_deref()); self.keyword_sets = prefs.keyword_sets; self.keyword_set = prefs.keyword_set; self.recent_keywords = prefs.recent_keywords; @@ -539,7 +539,11 @@ impl Session { self.presets.push(u); } } - let known = |id: &String| crate::presets::profile(id).is_some() || self.lut_profiles.iter().any(|p| &p.id == id); + let known = |id: &String| { + crate::presets::profile(id).is_some() + || self.lut_profiles.iter().any(|p| &p.id == id) + || self.dcp_profiles.iter().any(|p| &p.id == id) + }; self.profile_favorites = f.profile_favorites.into_iter().filter(known).collect(); self.profile_recent = f.profile_recent.into_iter().filter(known).take(crate::presets::RECENT_PROFILES).collect(); } diff --git a/crates/engine/src/media.rs b/crates/engine/src/media.rs index 24061347a61..67ccd8a303c 100644 --- a/crates/engine/src/media.rs +++ b/crates/engine/src/media.rs @@ -403,7 +403,25 @@ pub struct MediaCache { /// Which photos have a cached denoised picture, and how to read it. pub denoise: DenoiseIndex, /// Imported camera profiles by id ([`crate::cmd::dcp_profiles`]), handed to the decoder of photos using them. - pub camera_profiles: std::collections::HashMap>, + pub camera_profiles: std::collections::HashMap, +} + +/// An imported camera profile ready for the decoder, with a fingerprint of its file: decoded sources and cached renders +/// made with it carry the fingerprint, so a profile deleted, or replaced by another under the same id, never has +/// its old pictures stand in. +#[derive(Clone, Debug)] +pub struct LoadedCameraProfile { + pub profile: Arc, + /// Never 0 (0 is "no camera profile" in a render key). + pub fingerprint: u64, +} + +impl LoadedCameraProfile { + /// Parse a `.dcp` file's bytes. + pub fn parse(bytes: &[u8]) -> Result { + let profile = lightcraft_raw::dcp::parse_dcp(bytes)?; + Ok(LoadedCameraProfile { profile: Arc::new(profile), fingerprint: Hasher128::new().update(bytes).finish().0 as u64 | 1 }) + } } /// The photos that have a cached denoised picture for the denoise model in use. Only memory: nothing here touches the @@ -626,7 +644,7 @@ impl MediaCache { self.insert_source(id, level, DecodedSource::new(img, None)); } - fn insert_source(&mut self, id: PhotoId, level: SourceLevel, img: DecodedSource) { + pub(crate) fn insert_source(&mut self, id: PhotoId, level: SourceLevel, img: DecodedSource) { let tick = lightcraft_preview::next_tick(); match level { SourceLevel::Thumb => { @@ -719,11 +737,12 @@ impl MediaCache { return SourceRef::Loaded(Box::new(a)); } // a thumbnail of a photo whose preview is decoded (the one in the loupe) is cut from it; not - // with a denoised picture, which the thumbnail would lose + // with a denoised picture, which the thumbnail would lose, nor from one decoded with another camera profile if cached && level == SourceLevel::Thumb && self.denoise.spec(p.id).is_none() && let Some(big) = self.get_source(p.id, SourceLevel::Preview) + && big.camera_profile == wanted.as_ref().map(|(tag, _)| tag.clone()) { return SourceRef::Fit { from: Box::new(big), max_edge: level.max_edge() }; } @@ -759,13 +778,23 @@ impl MediaCache { r } - /// The imported camera profile photo `p` develops with: its profile setting names one this library has. + /// The imported camera profile photo `p` develops with, when its profile setting names one this library has: what a + /// source decoded with it is tagged with (its id and the file's fingerprint), and the profile. pub fn camera_profile_of(&self, p: &Photo) -> Option<(String, Arc)> { let id = &p.develop.profile.id; if !crate::cmd::dcp_profiles::is_dcp_id(id) { return None; } - self.camera_profiles.get(id).map(|d| (id.clone(), d.clone())) + self.camera_profiles.get(id).map(|d| (format!("{id}#{:016x}", d.fingerprint), d.profile.clone())) + } + + /// What a render with profile `profile_id` adds to its cache keys: the imported camera profile's fingerprint, 0 + /// for any other profile and for a camera profile this library no longer has (it renders without it). + pub fn camera_profile_salt(&self, profile_id: &str) -> u64 { + if !crate::cmd::dcp_profiles::is_dcp_id(profile_id) { + return 0; + } + self.camera_profiles.get(profile_id).map_or(0, |d| d.fingerprint) } /// How to load `origin` at most `max_edge` pixels long, ignoring decoded sources in memory (a @@ -1345,6 +1374,7 @@ impl crate::Session { // Temporary "before" settings must not replace the photo's cached develop hash. let settings_hash = if before { settings.hash64() } else { self.media.settings_hashes.get(id, &settings) }; let salt = self.media.denoise_salt(id, &settings); + let profile_salt = self.media.camera_profile_salt(&settings.profile.id); let key = settings_hash ^ ((max_w as u64) << 40) ^ ((max_h as u64) << 20) @@ -1352,7 +1382,8 @@ impl crate::Session { ^ (level as u64) << 60 ^ id.0.wrapping_mul(0x9e37_79b9_7f4a_7c15) ^ content.rotate_left(17) - ^ salt; + ^ salt + ^ profile_salt.rotate_left(29); let cache = thumb_bucket.map(|b| { let mut k = Hasher128::new(); k.str(&content_key).u64(settings_hash).u64(b as u64).u64(RENDER_CACHE_VERSION).u64(crate::camera_profiles::cache_key()); @@ -1360,6 +1391,10 @@ impl crate::Session { if salt != 0 { k.u64(salt); } + // (likewise an imported camera profile's file: deleted or replaced, the thumbnail renders afresh) + if profile_salt != 0 { + k.str("dcp").u64(profile_salt); + } (self.media.rendered.clone(), k.finish()) }); Some(RenderJob { @@ -1402,15 +1437,19 @@ impl crate::Session { } /// Cache key of a variant thumbnail ([`Self::variant_job`]). - pub fn variant_key(p: &Photo, settings: &DevelopSettings, edge: usize) -> Hash128 { - Hasher128::new() - .str(&content_key(p)) + /// `profile_salt`: [`MediaCache::camera_profile_salt`] of `settings`' profile. + pub fn variant_key(p: &Photo, settings: &DevelopSettings, edge: usize, profile_salt: u64) -> Hash128 { + let mut k = Hasher128::new(); + k.str(&content_key(p)) .str("variant") .u64(settings.hash64()) .u64(edge as u64) .u64(RENDER_CACHE_VERSION) - .u64(crate::camera_profiles::cache_key()) - .finish() + .u64(crate::camera_profiles::cache_key()); + if profile_salt != 0 { + k.str("dcp").u64(profile_salt); + } + k.finish() } /// A thumbnail of `id` rendered with `settings` instead of its own (profile and preset @@ -1425,7 +1464,7 @@ impl crate::Session { // decoded as these settings develop it (their camera profile, or none) p.develop = Arc::new(settings.clone()); let source = self.media.source_ref(&p, level); - let ck = Self::variant_key(&p, settings, edge); + let ck = Self::variant_key(&p, settings, edge, self.media.camera_profile_salt(&settings.profile.id)); Some(RenderJob { request_id: 0, cache_generation: self.media.rendered.generation(), @@ -1479,7 +1518,7 @@ impl crate::Session { let needed = (edge as f64 * w.max(h) / side).ceil().min(SourceLevel::Preview.max_edge() as f64); let level = SourceLevel::for_size(needed as usize); let source = self.media.source_ref(&p, level); - let ck = Self::variant_key(&p, &settings, edge); + let ck = Self::variant_key(&p, &settings, edge, self.media.camera_profile_salt(&settings.profile.id)); let preview_cut = self.face_preview_cut(&p, rect, edge, needed as usize); Some(RenderJob { request_id: 0, @@ -1520,15 +1559,19 @@ impl crate::Session { } /// Size-independent cache key of a photo's view render (loupe) for its current settings. - fn view_key(p: &Photo, apply_crop: bool) -> Hash128 { - Hasher128::new() - .str(&content_key(p)) + /// `profile_salt`: [`MediaCache::camera_profile_salt`] of the photo's profile. + fn view_key(p: &Photo, apply_crop: bool, profile_salt: u64) -> Hash128 { + let mut k = Hasher128::new(); + k.str(&content_key(p)) .str("view") .u64(p.develop.hash64()) .u64(apply_crop as u64) .u64(RENDER_CACHE_VERSION) - .u64(crate::camera_profiles::cache_key()) - .finish() + .u64(crate::camera_profiles::cache_key()); + if profile_salt != 0 { + k.str("dcp").u64(profile_salt); + } + k.finish() } /// The loupe's render job: like [`Self::render_job`], and a full-quality result is kept as the @@ -1536,7 +1579,8 @@ impl crate::Session { pub fn loupe_job(&mut self, id: PhotoId, max_w: usize, max_h: usize, apply_crop: bool) -> Option { let mut job = self.render_job(id, max_w, max_h, false, apply_crop)?; let p = self.catalog.photo(id)?; - job.view_cache = Some((self.media.rendered.clone(), Self::view_key(p, apply_crop))); + let profile_salt = self.media.camera_profile_salt(&p.develop.profile.id); + job.view_cache = Some((self.media.rendered.clone(), Self::view_key(p, apply_crop, profile_salt))); Some(job) } @@ -1645,8 +1689,9 @@ impl crate::Session { let p = self.catalog.photo(id)?.clone(); let small = self.thumb_job(id, THUMB_SIZES[THUMB_SIZES.len() - 1])?; // (the thumbnail job itself starts with the cached thumbnail, after the sharper embedded preview) - let cached = vec![(self.media.rendered.clone(), Self::view_key(&p, apply_crop))]; - let h = Hasher128::new().str(&content_key(&p)).str("quick").u64(p.develop.hash64()).u64(apply_crop as u64).finish(); + let profile_salt = self.media.camera_profile_salt(&p.develop.profile.id); + let cached = vec![(self.media.rendered.clone(), Self::view_key(&p, apply_crop, profile_salt))]; + let h = Hasher128::new().str(&content_key(&p)).str("quick").u64(p.develop.hash64()).u64(apply_crop as u64).u64(profile_salt).finish(); let key = h.0 as u64; let embedded = self.embedded_of(&p).map(|(path, l)| (path, l, max_edge.clamp(1, SourceLevel::Preview.max_edge()))); Some(QuickJob { request_id: 0, photo: id, key, cached, embedded, small: apply_crop.then(|| Box::new(small)) }) diff --git a/crates/engine/src/tests_dcp.rs b/crates/engine/src/tests_dcp.rs index 2bbb2cec717..be7b5b243d5 100644 --- a/crates/engine/src/tests_dcp.rs +++ b/crates/engine/src/tests_dcp.rs @@ -115,11 +115,14 @@ fn import_choose_cache_persist_and_delete() { s.execute("develop.profile", &json!({"id": dcp_id})).unwrap(); let job = s.render_job(id, 48, 48, false, true).unwrap(); match &job.source { - SourceRef::File { camera_profile: Some((pid, _)), .. } => assert_eq!(pid, &dcp_id), + SourceRef::File { camera_profile: Some((pid, _)), .. } => assert!(pid.starts_with(&format!("{dcp_id}#")), "{pid}"), _ => panic!("the photo is decoded again with its camera profile"), } let after = job.run(); - assert_eq!(after.loaded.as_ref().and_then(|l| l.camera_profile.clone()).as_deref(), Some(dcp_id.as_str())); + assert_eq!( + after.loaded.as_ref().and_then(|l| l.camera_profile.clone()), + s.media.camera_profile_of(s.catalog.photo(id).unwrap()).map(|c| c.0) + ); assert!(after.rendered.is_ok()); assert_ne!(mean_rgb(&before.loaded.unwrap().image), mean_rgb(&after.loaded.unwrap().image)); s.persist().unwrap(); @@ -187,3 +190,109 @@ fn hover_previews_and_browser_thumbnails_decode_with_the_hovered_camera_profile( assert!(close(back, builtin), "{back:?} vs {builtin:?}"); let _ = std::fs::remove_dir_all(&dir); } + +/// A library with one raw photo and the `Swap` profile imported from `files//Swap.dcp` and selected for it. +fn library_with_profile(dir: &std::path::Path) -> (Session, PhotoId, String) { + let (lib, files) = (dir.join("lib"), dir.join("files")); + std::fs::create_dir_all(files.join("a")).unwrap(); + let raw = files.join("IMG_0003.dng"); + std::fs::write(&raw, crate::tests_xmp::synthetic_dng_with(None, Default::default())).unwrap(); + std::fs::write(files.join("a").join("Swap.dcp"), write_dcp(&swapping_profile("Swap")).unwrap()).unwrap(); + let mut s = Session::new().with_fs(); + s.open_library(&lib, false).unwrap(); + let r = s.execute("library.import", &json!({"paths": [raw.to_string_lossy()]})).unwrap(); + let id = PhotoId(r["imported"][0].as_u64().unwrap()); + s.execute("library.select", &json!({"ids": [id.0]})).unwrap(); + let r = s.execute("profile.import", &json!({"paths": [files.join("a").join("Swap.dcp").to_string_lossy()]})).unwrap(); + let dcp_id = r["imported"][0]["id"].as_str().unwrap().to_string(); + s.execute("develop.profile", &json!({"id": dcp_id})).unwrap(); + (s, id, dcp_id) +} + +/// The thumbnail, browser-thumbnail and loupe cache keys of photo `id` (as it is now), and its source tag. +fn render_keys(s: &mut Session, id: PhotoId) -> [lightcraft_preview::Hash128; 3] { + let settings = (*s.develop_of(id).unwrap()).clone(); + [ + s.thumb_job(id, 256).unwrap().cache.unwrap().1, + s.variant_job(id, &settings, 64).unwrap().cache.unwrap().1, + s.loupe_job(id, 200, 200, true).unwrap().view_cache.unwrap().1, + ] +} + +/// A camera profile deleted, or replaced by a different file under the same id, never has renders or decoded +/// sources made with the old one stand in: before, the cache keys followed only the profile id, which the photo keeps. +#[test] +fn a_deleted_or_replaced_camera_profile_never_reuses_renders_made_with_it() { + let dir = temp_dir("replace"); + let (mut s, id, dcp_id) = library_with_profile(&dir); + let with = render_keys(&mut s, id); + let level = s.render_job(id, 48, 48, false, true).unwrap().level; + let old_tag = s.media.camera_profile_of(s.catalog.photo(id).unwrap()).map(|c| c.0); + assert!(old_tag.is_some()); + // deleted: the photo keeps the id, renders without the profile, under other keys + s.execute("profile.deleteImported", &json!({"id": dcp_id})).unwrap(); + assert_eq!(s.catalog.photo(id).unwrap().develop.profile.id, dcp_id); + let without = render_keys(&mut s, id); + for (a, b) in with.iter().zip(&without) { + assert_ne!(a, b, "a render made with the deleted profile would stand in"); + } + // another profile under the same file name gets the same id back, and other keys again + let other_dir = dir.join("files").join("b"); + std::fs::create_dir_all(&other_dir).unwrap(); + let mut other = swapping_profile("Swap"); + other.color.color_matrix = [Some(Mat3([[3.2406, -1.5372, -0.4986], [-0.9689, 1.8758, 0.0415], [0.0557, -0.2040, 1.0570]])), None]; + std::fs::write(other_dir.join("Swap.dcp"), write_dcp(&other).unwrap()).unwrap(); + let r = s.execute("profile.import", &json!({"paths": [other_dir.join("Swap.dcp").to_string_lossy()]})).unwrap(); + assert_eq!(r["imported"][0]["id"], dcp_id.as_str(), "{r}"); + let replaced = render_keys(&mut s, id); + for ((a, b), c) in with.iter().zip(&without).zip(&replaced) { + assert_ne!(a, c, "a render made with the replaced profile would stand in"); + assert_ne!(b, c); + } + // nor does a source decoded with the old file + let img = std::sync::Arc::new(lightcraft_raster::Rgb32f::new(4, 4)); + s.media.insert_source(id, level, crate::media::DecodedSource { camera_profile: old_tag, ..crate::media::DecodedSource::new(img, None) }); + assert!(!matches!(s.render_job(id, 48, 48, false, true).unwrap().source, SourceRef::Loaded(_)), "decoded again with the new file"); + let _ = std::fs::remove_dir_all(&dir); +} + +/// A grid thumbnail is cut from the photo's decoded preview only when that preview was decoded with the camera profile +/// the photo uses now; before, one made with another profile (or none) was fitted and cached under the new key. +#[test] +fn a_thumbnail_is_not_cut_from_a_preview_decoded_with_another_camera_profile() { + let dir = temp_dir("fit"); + let (mut s, id, _) = library_with_profile(&dir); + let p = (**s.catalog.photo(id).unwrap()).clone(); + let tag = s.media.camera_profile_of(&p).map(|c| c.0); + let img = std::sync::Arc::new(lightcraft_raster::Rgb32f::new(1600, 1000)); + let preview = |camera_profile| crate::media::DecodedSource { camera_profile, ..crate::media::DecodedSource::new(img.clone(), None) }; + use crate::media::SourceLevel; + s.media.insert_source(id, SourceLevel::Preview, preview(None)); + assert!(!matches!(s.media.source_ref(&p, SourceLevel::Thumb), SourceRef::Fit { .. }), "decoded without the profile"); + s.media.insert_source(id, SourceLevel::Preview, preview(tag)); + assert!(matches!(s.media.source_ref(&p, SourceLevel::Thumb), SourceRef::Fit { .. }), "decoded with it: still cut from it"); + let _ = std::fs::remove_dir_all(&dir); +} + +/// A library moved (or restored) elsewhere finds its camera profiles in its own `Profiles/` folder, and a camera +/// profile can be a favourite, which survives reopening like the recent list. +#[test] +fn a_moved_library_keeps_its_camera_profiles_and_their_favourites() { + let dir = temp_dir("moved"); + let (mut s, id, dcp_id) = library_with_profile(&dir); + assert_eq!(s.execute("profile.favorite", &json!({"id": dcp_id})).unwrap()["favorite"], true); + assert!(s.profile_recent.contains(&dcp_id)); + s.persist().unwrap(); + s.close_library().unwrap(); + drop(s); + let moved = dir.join("moved"); + std::fs::rename(dir.join("lib"), &moved).unwrap(); + let mut s = Session::new().with_fs(); + s.open_library(&moved, false).unwrap(); + assert!(s.media.camera_profiles.contains_key(&dcp_id), "the profile is found in the moved library"); + assert!(std::path::Path::new(&s.dcp_profiles[0].file).starts_with(&moved), "{}", s.dcp_profiles[0].file); + assert!(s.media.camera_profile_of(s.catalog.photo(id).unwrap()).is_some()); + assert!(s.profile_favorites.contains(&dcp_id) && s.profile_recent.contains(&dcp_id)); + s.close_library().unwrap(); + let _ = std::fs::remove_dir_all(&dir); +} From 46946248258bd2f4b63d9a0d8c11159914a9cb36 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Sat, 24 Oct 2026 08:58:53 +1000 Subject: [PATCH 12/27] LR-PROF-IMPORT: smart previews without the camera profile, current-profile source facts, unsupported files reported CodeRabbit review of 4ef025d9: - Build Smart Previews develops the proxy without the photo's imported camera profile and never takes a cached source decoded with it (the denoised picture is kept); before, only the stale-proxy refresh left it out. - Session::source_info reports decoder facts only from a cached source developed with the camera profile the photo uses now, else the catalog's. - profile.import reports a file that is neither .cube, .dcp nor .zip as failed instead of passing over it. Each with a regression test in tests_dcp.rs. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/lut_profiles.rs | 4 +- crates/engine/src/cmd/previews.rs | 4 +- crates/engine/src/media.rs | 30 +++++++++--- crates/engine/src/tests_dcp.rs | 70 +++++++++++++++++++++++++++ 4 files changed, 99 insertions(+), 9 deletions(-) diff --git a/crates/engine/src/cmd/lut_profiles.rs b/crates/engine/src/cmd/lut_profiles.rs index 97c8b03b2a3..4039aa98ec6 100644 --- a/crates/engine/src/cmd/lut_profiles.rs +++ b/crates/engine/src/cmd/lut_profiles.rs @@ -82,8 +82,10 @@ fn cube_files(paths: &[String]) -> (Vec<(String, String, Option)>, Vec out.push((stem(path), t, None)), Err(e) => failed.push(json!([stem(path), e.to_string()])), } + } else if !path.extension().is_some_and(|x| x.eq_ignore_ascii_case("dcp")) { + // (a .dcp is a camera profile: `dcp_profiles::import_files` takes it) + failed.push(json!([stem(path), "not a .cube, .dcp or .zip file"])); } - // (a .dcp is a camera profile: `dcp_profiles::import_files` takes it) } (out, failed) } diff --git a/crates/engine/src/cmd/previews.rs b/crates/engine/src/cmd/previews.rs index cb331269e93..4e9136961e5 100644 --- a/crates/engine/src/cmd/previews.rs +++ b/crates/engine/src/cmd/previews.rs @@ -346,7 +346,9 @@ fn smart(s: &mut Session, p: &Value) -> Result { continue; } let path = crate::smart::sharded_file_path(&dir, &ph); - let source = (!discard).then(|| s.media.source_ref(&ph, crate::media::SourceLevel::Preview)); + // (a smart preview keeps the file's own colour: never built with the photo's imported camera profile, nor + // from a cached source developed with it) + let source = (!discard).then(|| s.media.source_ref_without_profile(&ph, crate::media::SourceLevel::Preview)); jobs.push((id, path, source, preview_fitted_look(&ph))); } let custom = s.smart_previews_dir.is_some(); diff --git a/crates/engine/src/media.rs b/crates/engine/src/media.rs index 67ccd8a303c..d792ef98365 100644 --- a/crates/engine/src/media.rs +++ b/crates/engine/src/media.rs @@ -625,14 +625,16 @@ impl MediaCache { } /// The facts of photo `id`'s cached sources: the decoder's when one has them, else `header` - /// (with a smart preview's stored camera tone curve). - fn source_facts(&self, id: PhotoId, header: SourceInfo) -> SourceInfo { + /// (with a smart preview's stored camera tone curve). Only sources developed with `profile` (the photo's imported + /// camera profile tag, [`Self::camera_profile_of`], or none) count: one made with another profile has its facts. + fn source_facts(&self, id: PhotoId, header: SourceInfo, profile: Option<&str>) -> SourceInfo { let cached = || { self.thumbs .peek(&id) .into_iter() .chain(self.previews.iter().filter(|e| e.0 == id).map(|e| &e.1)) .chain(self.full.iter().filter(|e| e.0 == id).map(|e| &e.1)) + .filter(|s| s.camera_profile.as_deref() == profile) }; match cached().find(|s| s.info.is_some()).or_else(|| cached().next()) { Some(s) => s.info_or(header), @@ -719,16 +721,28 @@ impl MediaCache { self.source_ref_with(p, level, false) } + /// [`Self::source_ref`] without the photo's imported camera profile (keeping its denoised picture): a smart + /// preview keeps the file's own colour, and a cached source developed with the profile doesn't stand in for it. + #[cfg(not(target_arch = "wasm32"))] + pub fn source_ref_without_profile(&mut self, p: &Photo, level: SourceLevel) -> SourceRef { + self.source_ref_for(p, level, true, None) + } + fn source_ref_with(&mut self, p: &Photo, level: SourceLevel, cached: bool) -> SourceRef { - let mut r = self.source_ref_plain(p, level, cached); + let wanted = self.camera_profile_of(p); + self.source_ref_for(p, level, cached, wanted) + } + + /// [`Self::source_ref_with`] developed with camera profile `wanted` (none: the file's own colour). + fn source_ref_for(&mut self, p: &Photo, level: SourceLevel, cached: bool, wanted: Option<(String, Arc)>) -> SourceRef { + let mut r = self.source_ref_plain(p, level, cached, wanted); if let (SourceRef::File { denoise, .. }, Some((spec, loader))) = (&mut r, self.denoise.get(p.id)) { *denoise = Some((spec.clone(), loader.clone())); } r } - fn source_ref_plain(&mut self, p: &Photo, level: SourceLevel, cached: bool) -> SourceRef { - let wanted = self.camera_profile_of(p); + fn source_ref_plain(&mut self, p: &Photo, level: SourceLevel, cached: bool, wanted: Option<(String, Arc)>) -> SourceRef { // (a source developed with another camera profile, or none, doesn't stand in) if cached && let Some(a) = self.get_source(p.id, level) @@ -1810,8 +1824,10 @@ impl crate::Session { /// Prefer decoder facts to header-only metadata for pixel-statistics commands. pub fn source_info(&self, id: PhotoId) -> SourceInfo { - let header = self.catalog.photo(id).map(|p| source_info(p)).unwrap_or_default(); - self.media.source_facts(id, header) + let photo = self.catalog.photo(id); + let header = photo.map(|p| source_info(p)).unwrap_or_default(); + let profile = photo.and_then(|p| self.media.camera_profile_of(p)).map(|(tag, _)| tag); + self.media.source_facts(id, header, profile.as_deref()) } /// The source proxy for pixel-statistics commands (auto tone/WB), loading synchronously. diff --git a/crates/engine/src/tests_dcp.rs b/crates/engine/src/tests_dcp.rs index be7b5b243d5..a620d883218 100644 --- a/crates/engine/src/tests_dcp.rs +++ b/crates/engine/src/tests_dcp.rs @@ -296,3 +296,73 @@ fn a_moved_library_keeps_its_camera_profiles_and_their_favourites() { s.close_library().unwrap(); let _ = std::fs::remove_dir_all(&dir); } + +fn distance(a: [f32; 3], b: [f32; 3]) -> f32 { + (0..3).map(|i| (a[i] - b[i]).abs()).sum() +} + +/// A smart preview keeps the file's own colour: Build Smart Previews never develops it with the photo's imported +/// camera profile, nor takes a cached source decoded with it. Before, only the stale-proxy refresh left the profile out. +#[test] +fn smart_previews_are_built_without_the_imported_camera_profile() { + use crate::media::{DecodedSource, SourceLevel}; + let dir = temp_dir("smart"); + let (mut s, id, _) = library_with_profile(&dir); + let p = (**s.catalog.photo(id).unwrap()).clone(); + s.execute("library.smartPreviews", &json!({"ids": [id.0], "discard": true})).unwrap(); + // a cached preview decoded with the profile (flat magenta, so it shows if the proxy is cut from it) + let tag = s.media.camera_profile_of(&p).map(|c| c.0); + let mut magenta = lightcraft_raster::Rgb32f::new(8, 8); + magenta.data.iter_mut().for_each(|px| *px = [1.0, 0.0, 1.0]); + s.media.insert_source(id, SourceLevel::Preview, DecodedSource { camera_profile: tag, ..DecodedSource::new(std::sync::Arc::new(magenta), None) }); + let r = s.execute("library.smartPreviews", &json!({"ids": [id.0]})).unwrap(); + assert_eq!((r["built"].as_u64(), r["repaired"].as_u64()), (Some(1), Some(0)), "{r}"); + let smart_dir = s.media.smart_dir.clone().unwrap(); + let proxy = crate::smart::load(&crate::smart::existing_file_path(&smart_dir, crate::smart::sharded_file_path(&smart_dir, &p))).unwrap(); + let got = mean_rgb(&proxy.image); + let dng = std::fs::read(dir.join("files").join("IMG_0003.dng")).unwrap(); + let edge = SourceLevel::Preview.max_edge(); + let plain = mean_rgb(&crate::files::load_bytes(&dng, edge).unwrap().0); + let with = mean_rgb(&crate::files::load_bytes_with(&dng, edge, Some(&swapping_profile("Swap"))).unwrap().0); + assert!(distance(got, plain) < distance(got, with), "the proxy has the file's own colour: {got:?}, plain {plain:?}, profiled {with:?}"); + // nor from the file developed with the profile + s.media.forget(id); + s.execute("library.smartPreviews", &json!({"ids": [id.0], "discard": true})).unwrap(); + s.execute("library.smartPreviews", &json!({"ids": [id.0]})).unwrap(); + let proxy = crate::smart::load(&crate::smart::existing_file_path(&smart_dir, crate::smart::sharded_file_path(&smart_dir, &p))).unwrap(); + let got = mean_rgb(&proxy.image); + assert!(distance(got, plain) < distance(got, with), "the proxy has the file's own colour: {got:?}, plain {plain:?}, profiled {with:?}"); + let _ = std::fs::remove_dir_all(&dir); +} + +/// The decoder facts reported for a photo come from a cached source developed with the camera profile it uses now; +/// before, a thumbnail decoded with another profile (or none) answered first. +#[test] +fn source_facts_come_from_a_source_developed_with_the_current_camera_profile() { + use crate::media::{DecodedSource, SourceLevel}; + let dir = temp_dir("facts"); + let (mut s, id, _) = library_with_profile(&dir); + let tag = s.media.camera_profile_of(s.catalog.photo(id).unwrap()).map(|c| c.0); + let img = std::sync::Arc::new(lightcraft_raster::Rgb32f::new(4, 4)); + let facts = |temp: f64, camera_profile| DecodedSource { + camera_profile, + ..DecodedSource::new(img.clone(), Some(lightcraft_pipeline::SourceInfo { as_shot_temp: temp, ..Default::default() })) + }; + s.media.insert_source(id, SourceLevel::Thumb, facts(3100.0, None)); + s.media.insert_source(id, SourceLevel::Preview, facts(6200.0, tag)); + assert_eq!(s.source_info(id).as_shot_temp, 6200.0); + let _ = std::fs::remove_dir_all(&dir); +} + +/// A file that is neither a `.cube`, a `.dcp` nor a `.zip` is reported as failed instead of being passed over. +#[test] +fn importing_an_unsupported_profile_file_reports_it() { + let dir = temp_dir("unsupported"); + let notes = dir.join("notes.txt"); + std::fs::write(¬es, "not a profile").unwrap(); + let mut s = Session::new(); + let r = s.execute("profile.import", &json!({"paths": [notes.to_string_lossy()]})).unwrap(); + assert_eq!(r["imported"].as_array().map(Vec::len), Some(0), "{r}"); + assert_eq!(r["failed"], json!([["notes", "not a .cube, .dcp or .zip file"]]), "{r}"); + let _ = std::fs::remove_dir_all(&dir); +} From 42c414d806daaad03b313fad234c1a3d07e0f084 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Sun, 25 Oct 2026 07:41:54 +1000 Subject: [PATCH 13/27] LR-PROF-IMPORT: the Before side decodes with its own camera profile; a failed profile copy fails that file only - build_job (and region_job_before through it) picks the Before render's source with the Before settings, so it never reuses or decodes a source developed with the edit's camera profile. - profile.import: a .dcp whose copy into the library fails is reported in `failed`; the profiles imported with it stay imported and are saved, and nothing half-written is left. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/dcp_profiles.rs | 10 ++++- crates/engine/src/media.rs | 9 ++++- crates/engine/src/tests_dcp.rs | 55 +++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/cmd/dcp_profiles.rs b/crates/engine/src/cmd/dcp_profiles.rs index 4bc43113e0d..858ed2bef76 100644 --- a/crates/engine/src/cmd/dcp_profiles.rs +++ b/crates/engine/src/cmd/dcp_profiles.rs @@ -137,7 +137,15 @@ pub fn import_files(s: &mut Session, paths: &[String]) -> Result<(Vec, Ve let file = match &dir { Some(d) => { let to = d.join(format!("{}.dcp", id.trim_start_matches(DCP_PREFIX))); - std::fs::write(&to, &bytes).map_err(|e| bad(C, format!("{}: {e}", to.display())))?; + // a copy that fails (disk full, no access) fails this file only: the profiles + // copied before it stay imported, and nothing half-written is left behind + if let Err(e) = std::fs::write(&to, &bytes) { + if to.is_file() { + let _ = std::fs::remove_file(&to); + } + failed.push(json!([shown, format!("{}: {e}", to.display())])); + continue; + } to.to_string_lossy().to_string() } // no library on disk: remember the original (the in-memory session ends with the app) diff --git a/crates/engine/src/media.rs b/crates/engine/src/media.rs index 4746f4aa82c..95854c6937e 100644 --- a/crates/engine/src/media.rs +++ b/crates/engine/src/media.rs @@ -1377,7 +1377,14 @@ impl crate::Session { } else { source_edge_needed(&p, &settings, apply_crop, max_w.max(max_h)) }); - let source = self.media.source_ref(&p, level); + // the Before side develops with the Before settings' camera profile (or none), not the edit's + let source = if before { + let mut q = (*p).clone(); + q.develop = settings.clone(); + self.media.source_ref(&q, level) + } else { + self.media.source_ref(&p, level) + }; let request = RenderRequest { apply_crop, ..RenderRequest::fit(max_w, max_h) }; // the photo id is part of the key: two photos with the same settings and size must not // share a result (a view slot showing photo A would otherwise look current for photo B) diff --git a/crates/engine/src/tests_dcp.rs b/crates/engine/src/tests_dcp.rs index a620d883218..2f79c6ae15e 100644 --- a/crates/engine/src/tests_dcp.rs +++ b/crates/engine/src/tests_dcp.rs @@ -354,6 +354,61 @@ fn source_facts_come_from_a_source_developed_with_the_current_camera_profile() { let _ = std::fs::remove_dir_all(&dir); } +/// The Before side (and its region renders) decodes with the Before settings' camera profile — here none, the +/// import defaults — not with the edit's: before, it reused or decoded a source developed with the edit's profile. +#[test] +fn the_before_side_decodes_with_its_own_camera_profile() { + use crate::media::{DecodedSource, SourceLevel}; + let dir = temp_dir("before"); + let (mut s, id, _) = library_with_profile(&dir); + let camera = |job: &crate::media::RenderJob| match &job.source { + SourceRef::File { camera_profile, .. } => camera_profile.as_ref().map(|c| c.0.clone()), + SourceRef::Loaded(a) => a.camera_profile.clone(), + _ => None, + }; + s.media.forget(id); + let after = s.render_job(id, 256, 256, false, true).unwrap(); + let tag = camera(&after); + assert!(tag.is_some(), "the edit develops with the imported profile"); + let before = s.render_job(id, 256, 256, true, true).unwrap(); + assert_eq!(camera(&before), None, "the Before side develops with the file's own colour"); + // nor does a cached source developed with the edit's profile stand in for it + for level in [SourceLevel::Thumb, SourceLevel::Preview, SourceLevel::Full] { + let img = std::sync::Arc::new(lightcraft_raster::Rgb32f::new(4, 4)); + s.media.insert_source(id, level, DecodedSource { camera_profile: tag.clone(), ..DecodedSource::new(img, None) }); + } + let before = s.render_job(id, 256, 256, true, true).unwrap(); + assert!(!matches!(before.source, SourceRef::Loaded(_)), "the Before side is decoded afresh"); + assert_eq!(camera(&before), None); + let _ = std::fs::remove_dir_all(&dir); +} + +/// A profile whose copy into the library fails is reported as failed on its own: the profiles imported with +/// it stay imported (and are saved), and the command does not fail. +#[test] +fn a_profile_that_cannot_be_copied_fails_on_its_own() { + let dir = temp_dir("copy-fails"); + let (lib, files) = (dir.join("lib"), dir.join("files")); + std::fs::create_dir_all(&files).unwrap(); + for name in ["A", "B"] { + std::fs::write(files.join(format!("{name}.dcp")), write_dcp(&swapping_profile(name)).unwrap()).unwrap(); + } + let mut s = Session::new().with_fs(); + s.open_library(&lib, false).unwrap(); + // a folder where B's copy goes: writing it fails + let blocked = lib.join("Profiles").join(format!("{}.dcp", crate::presets::slug("LightCraft Test Camera-B"))); + std::fs::create_dir_all(&blocked).unwrap(); + let r = s.execute("profile.import", &json!({"paths": [files.to_string_lossy()]})).unwrap(); + let imported: Vec<&str> = r["imported"].as_array().unwrap().iter().filter_map(|p| p["name"].as_str()).collect(); + assert_eq!(imported, ["A"], "{r}"); + let failed = r["failed"].as_array().unwrap(); + assert_eq!(failed.len(), 1, "{r}"); + assert!(failed[0][0].as_str().is_some_and(|f| f.ends_with("B.dcp")), "{r}"); + assert_eq!(s.dcp_profiles.iter().map(|p| p.name.as_str()).collect::>(), ["A"]); + assert!(blocked.is_dir(), "the folder in the way is left alone"); + let _ = std::fs::remove_dir_all(&dir); +} + /// A file that is neither a `.cube`, a `.dcp` nor a `.zip` is reported as failed instead of being passed over. #[test] fn importing_an_unsupported_profile_file_reports_it() { From a3c82f98219178d7144dd13df969cf5f21327181 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Sun, 25 Oct 2026 14:58:46 +1000 Subject: [PATCH 14/27] LR-PROF-IMPORT: a cached smart preview stands in while the original is offline A smart preview carries no camera profile, so with an imported profile the profile check rejected the cached proxy and every render decoded it again (it gives the same picture). It now stands in, for its own level and for the thumbnail cut from it, while the original is known to be offline; otherwise the profile check is as before, so once the original is back the photo is decoded from it with its profile. Photos without an imported profile keep main's behaviour. Test `tests_dcp::a_cached_smart_preview_stands_in_while_the_original_is_offline` (fails without the fix). Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/media.rs | 13 ++++++++++--- crates/engine/src/tests_dcp.rs | 25 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/media.rs b/crates/engine/src/media.rs index 95854c6937e..c3abaccab30 100644 --- a/crates/engine/src/media.rs +++ b/crates/engine/src/media.rs @@ -742,11 +742,18 @@ impl MediaCache { r } + /// Is photo `p`'s original known to be missing (cached answer only)? + fn original_offline(&self, p: &Photo) -> bool { + matches!(&p.source, Source::File { path } if self.availability.is_offline(path)) + } + fn source_ref_plain(&mut self, p: &Photo, level: SourceLevel, cached: bool, wanted: Option<(String, Arc)>) -> SourceRef { - // (a source developed with another camera profile, or none, doesn't stand in) + // (a source developed with another camera profile, or none, doesn't stand in; a smart preview + // has no camera profile, and decoding it again gives the same picture, so it stands in while the + // original is offline) if cached && let Some(a) = self.get_source(p.id, level) - && a.camera_profile == wanted.as_ref().map(|(id, _)| id.clone()) + && (a.camera_profile == wanted.as_ref().map(|(id, _)| id.clone()) || (a.from_proxy && self.original_offline(p))) { return SourceRef::Loaded(Box::new(a)); } @@ -756,7 +763,7 @@ impl MediaCache { && level == SourceLevel::Thumb && self.denoise.spec(p.id).is_none() && let Some(big) = self.get_source(p.id, SourceLevel::Preview) - && big.camera_profile == wanted.as_ref().map(|(tag, _)| tag.clone()) + && (big.camera_profile == wanted.as_ref().map(|(tag, _)| tag.clone()) || (big.from_proxy && self.original_offline(p))) { return SourceRef::Fit { from: Box::new(big), max_edge: level.max_edge() }; } diff --git a/crates/engine/src/tests_dcp.rs b/crates/engine/src/tests_dcp.rs index 2f79c6ae15e..09f2c560836 100644 --- a/crates/engine/src/tests_dcp.rs +++ b/crates/engine/src/tests_dcp.rs @@ -335,6 +335,31 @@ fn smart_previews_are_built_without_the_imported_camera_profile() { let _ = std::fs::remove_dir_all(&dir); } +/// While the original is offline, a cached smart preview stands in for a photo developed with an imported camera +/// profile: it has no profile and decoding it again gives the same picture. Before, it was decoded again for every +/// render. Once the original is back, the photo is decoded from it with its profile. +#[test] +fn a_cached_smart_preview_stands_in_while_the_original_is_offline() { + use crate::media::{DecodedSource, SourceLevel, SourceRef}; + let dir = temp_dir("proxy-offline"); + let (mut s, id, _) = library_with_profile(&dir); + let p = (**s.catalog.photo(id).unwrap()).clone(); + assert!(s.media.camera_profile_of(&p).is_some()); + let proxy = DecodedSource { from_proxy: true, ..DecodedSource::new(std::sync::Arc::new(lightcraft_raster::Rgb32f::new(8, 8)), None) }; + s.media.insert_source(id, SourceLevel::Preview, proxy); + let offline = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(true)); + let probe_offline = offline.clone(); + s.media.availability.set_probe(std::sync::Arc::new(move |path: &str| { + !(path.ends_with("IMG_0003.dng") && probe_offline.load(std::sync::atomic::Ordering::Relaxed)) && std::path::Path::new(path).exists() + })); + assert!(matches!(s.media.source_ref(&p, SourceLevel::Preview), SourceRef::Loaded(a) if a.from_proxy), "the proxy stands in"); + assert!(matches!(s.media.source_ref(&p, SourceLevel::Thumb), SourceRef::Fit { .. }), "the thumbnail is cut from it"); + offline.store(false, std::sync::atomic::Ordering::Relaxed); + assert!(!matches!(s.media.source_ref(&p, SourceLevel::Preview), SourceRef::Loaded(_)), "the original is back: decoded with the profile"); + assert!(!matches!(s.media.source_ref(&p, SourceLevel::Thumb), SourceRef::Fit { .. })); + let _ = std::fs::remove_dir_all(&dir); +} + /// The decoder facts reported for a photo come from a cached source developed with the camera profile it uses now; /// before, a thumbnail decoded with another profile (or none) answered first. #[test] From 7dac66e45d9ed61f50b6e3c4b959a2c197a65715 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Tue, 27 Oct 2026 01:00:31 +1000 Subject: [PATCH 15/27] LR-PROF-IMPORT: deleting a camera profile removes the library's copy before forgetting it profile.deleteCamera now removes the library's copy of the profile file first. A copy that is already gone is fine; any other error (file in use, no access) fails the command and keeps the profile listed, so the library never holds a profile file it no longer lists. Test: a_profile_whose_copy_cannot_be_deleted_stays. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/dcp_profiles.rs | 14 ++++++++++---- crates/engine/src/tests_dcp.rs | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/dcp_profiles.rs b/crates/engine/src/cmd/dcp_profiles.rs index 858ed2bef76..461f93c771c 100644 --- a/crates/engine/src/cmd/dcp_profiles.rs +++ b/crates/engine/src/cmd/dcp_profiles.rs @@ -164,14 +164,20 @@ fn delete(s: &mut Session, p: &Value) -> Result { let Some(i) = s.dcp_profiles.iter().position(|x| x.id == id) else { return Err(bad(C, format!("no imported camera profile `{id}`"))); }; - let entry = s.dcp_profiles.remove(i); - s.media.camera_profiles.remove(&id); - // the library's copy goes; a file outside the library is the user's and stays + // the library's copy goes first; a file outside the library is the user's and stays. A copy that can't be + // removed (in use, no access) keeps the profile, so the library never holds a file it no longer lists. if let Some(d) = profiles_dir(s) + && let Some(entry) = s.dcp_profiles.get(i) && Path::new(&entry.file).starts_with(&d) { - let _ = std::fs::remove_file(&entry.file); + match std::fs::remove_file(&entry.file) { + Ok(()) => {} + Err(e) if e.kind() == std::io::ErrorKind::NotFound => {} + Err(e) => return Err(bad(C, format!("could not delete {}: {e}", entry.file))), + } } + s.dcp_profiles.remove(i); + s.media.camera_profiles.remove(&id); s.profile_favorites.retain(|f| f != &id); s.profile_recent.retain(|f| f != &id); s.save_prefs()?; diff --git a/crates/engine/src/tests_dcp.rs b/crates/engine/src/tests_dcp.rs index 09f2c560836..52262cdeaf7 100644 --- a/crates/engine/src/tests_dcp.rs +++ b/crates/engine/src/tests_dcp.rs @@ -446,3 +446,23 @@ fn importing_an_unsupported_profile_file_reports_it() { assert_eq!(r["failed"], json!([["notes", "not a .cube, .dcp or .zip file"]]), "{r}"); let _ = std::fs::remove_dir_all(&dir); } + +/// A library copy that can't be removed keeps its profile: the command fails and nothing is forgotten, so the +/// library never holds a profile file it no longer lists (CodeRabbit on #1063). +#[test] +fn a_profile_whose_copy_cannot_be_deleted_stays() { + let dir = temp_dir("delete-fails"); + let (mut s, _, dcp_id) = library_with_profile(&dir); + let file = s.dcp_profiles.iter().find(|p| p.id == dcp_id).map(|p| PathBuf::from(&p.file)).unwrap(); + // a folder in the copy's place: removing it as a file fails (as a file in use does) + std::fs::remove_file(&file).unwrap(); + std::fs::create_dir_all(&file).unwrap(); + let r = s.execute("profile.deleteCamera", &json!({"id": dcp_id})); + assert!(r.is_err(), "{r:?}"); + assert!(s.dcp_profiles.iter().any(|p| p.id == dcp_id), "the profile is still listed"); + // gone already: deleting just forgets it + std::fs::remove_dir_all(&file).unwrap(); + s.execute("profile.deleteCamera", &json!({"id": dcp_id})).unwrap(); + assert!(s.dcp_profiles.iter().all(|p| p.id != dcp_id)); + let _ = std::fs::remove_dir_all(&dir); +} From c739b7bf7e7ae7015c9b337aab29e7239d117b9c Mon Sep 17 00:00:00 2001 From: OneSlips Date: Tue, 27 Oct 2026 01:24:20 +1000 Subject: [PATCH 16/27] LR-PROF-IMPORT: deleting a camera profile never follows `..` out of the profiles folder A listed path with a `..` component can start with the profiles folder and still lead out of it; such a path is not treated as the library's copy, so deleting the profile leaves that file alone. Test: deleting_a_profile_never_follows_dot_dot_out_of_the_profiles_folder. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/dcp_profiles.rs | 4 +++- crates/engine/src/tests_dcp.rs | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/dcp_profiles.rs b/crates/engine/src/cmd/dcp_profiles.rs index 461f93c771c..d253434c99f 100644 --- a/crates/engine/src/cmd/dcp_profiles.rs +++ b/crates/engine/src/cmd/dcp_profiles.rs @@ -165,10 +165,12 @@ fn delete(s: &mut Session, p: &Value) -> Result { return Err(bad(C, format!("no imported camera profile `{id}`"))); }; // the library's copy goes first; a file outside the library is the user's and stays. A copy that can't be - // removed (in use, no access) keeps the profile, so the library never holds a file it no longer lists. + // removed (in use, no access) keeps the profile, so the library never holds a file it no longer lists. A path + // with `..` in it is never the library's copy (it could lead out of the profiles folder). if let Some(d) = profiles_dir(s) && let Some(entry) = s.dcp_profiles.get(i) && Path::new(&entry.file).starts_with(&d) + && !Path::new(&entry.file).components().any(|c| c == std::path::Component::ParentDir) { match std::fs::remove_file(&entry.file) { Ok(()) => {} diff --git a/crates/engine/src/tests_dcp.rs b/crates/engine/src/tests_dcp.rs index 52262cdeaf7..0df9eb5215c 100644 --- a/crates/engine/src/tests_dcp.rs +++ b/crates/engine/src/tests_dcp.rs @@ -466,3 +466,20 @@ fn a_profile_whose_copy_cannot_be_deleted_stays() { assert!(s.dcp_profiles.iter().all(|p| p.id != dcp_id)); let _ = std::fs::remove_dir_all(&dir); } + +/// A listed path that climbs out of the profiles folder with `..` is not the library's copy: deleting the profile +/// leaves that file alone (CodeRabbit on #1063). +#[test] +fn deleting_a_profile_never_follows_dot_dot_out_of_the_profiles_folder() { + let dir = temp_dir("delete-dotdot"); + let (mut s, _, dcp_id) = library_with_profile(&dir); + let entry = s.dcp_profiles.iter_mut().find(|p| p.id == dcp_id).unwrap(); + let profiles = PathBuf::from(&entry.file).parent().unwrap().to_path_buf(); + let outside = profiles.parent().unwrap().join("keep.txt"); + std::fs::write(&outside, b"the user's").unwrap(); + entry.file = profiles.join("..").join("keep.txt").to_string_lossy().into_owned(); + s.execute("profile.deleteCamera", &json!({"id": dcp_id})).unwrap(); + assert!(s.dcp_profiles.iter().all(|p| p.id != dcp_id), "forgotten"); + assert!(outside.exists(), "the file outside the profiles folder stays"); + let _ = std::fs::remove_dir_all(&dir); +} From d7eb0ef401b614e57d22b325b844e2bff2e0c462 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Wed, 28 Oct 2026 07:07:40 +1000 Subject: [PATCH 17/27] LR-PROF-IMPORT: both tone fits of a DNG see its lens opcodes; no side effect in the profile-tag comparison Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/files/load.rs | 69 ++++++++++++++++++++++++++---- crates/engine/src/media/session.rs | 7 ++- 2 files changed, 63 insertions(+), 13 deletions(-) diff --git a/crates/engine/src/files/load.rs b/crates/engine/src/files/load.rs index 8a7f0d2ebff..273ff3628ef 100644 --- a/crates/engine/src/files/load.rs +++ b/crates/engine/src/files/load.rs @@ -114,7 +114,12 @@ fn load_bytes_now( let kept_tone = match dcp { Some(p) if p.color.profile.tone_curve.is_none() => raw.color.profile.tone_curve.as_ref().and_then(dng_tone_curve).or_else(|| { let own = raw.color.clone(); - let tone = crate::camera_preview::starting_colour(&mut raw, &bytes, lens_geometry.as_ref(), lens.as_ref()).2.map(|look| look.tone); + // the same proxy as the starting colour's fit below: the DNG's lens opcodes back in, no embedded lens + let tone = with_dng_lens_ops(&mut raw, dng_lens_ops.as_ref(), lens.as_ref(), list3, |raw, embedded| { + crate::camera_preview::starting_colour(raw, &bytes, lens_geometry.as_ref(), embedded) + }) + .2 + .map(|look| look.tone); raw.color = own; tone }), @@ -131,14 +136,9 @@ fn load_bytes_now( // the source's segmentation mattes (DNG semantic masks), read while the starting colour is fitted let ((xy, t, camera_look), mattes) = rayon::join( || { - let removed = dng_lens_ops.map(|ops| std::mem::replace(&mut raw.opcodes.list3, ops)); - // With the opcodes restored, the proxy already includes vignetting; do not apply it twice. - let embedded = if removed.is_some() { None } else { lens.as_ref() }; - let colour = crate::camera_preview::starting_colour(&mut raw, &bytes, lens_geometry.as_ref(), embedded); - if let Some(ops) = removed { - raw.opcodes.list3 = ops; - } - colour + with_dng_lens_ops(&mut raw, dng_lens_ops.as_ref(), lens.as_ref(), list3, |raw, embedded| { + crate::camera_preview::starting_colour(raw, &bytes, lens_geometry.as_ref(), embedded) + }) }, || dng_mattes(&bytes, &info), ); @@ -382,3 +382,54 @@ pub(crate) fn dng_tone_curve(curve: &lightcraft_raw::profile::ToneCurve) -> Opti }); lightcraft_pipeline::tone::CameraTone::new(knots) } + +/// A raw's `OpcodeList3`. +fn list3(raw: &mut lightcraft_raw::RawImage) -> &mut Vec { + &mut raw.opcodes.list3 +} + +/// `fit(raw, embedded)` with a DNG's lens opcodes `ops` back in `raw`'s `OpcodeList3` (`list3`), as its preview has +/// them applied, and the list as it was afterwards. With the opcodes restored the proxy already includes the +/// vignetting, so `embedded` is `None` then (else `lens`): every tone fit of one photo sees the same proxy. +fn with_dng_lens_ops( + raw: &mut R, + ops: Option<&Vec>, + lens: Option<&L>, + list3: fn(&mut R) -> &mut Vec, + fit: impl FnOnce(&mut R, Option<&L>) -> T, +) -> T { + let removed = ops.map(|ops| std::mem::replace(list3(raw), ops.clone())); + let embedded = if removed.is_some() { None } else { lens }; + let out = fit(raw, embedded); + if let Some(ops) = removed { + *list3(raw) = ops; + } + out +} + +#[cfg(test)] +mod lens_ops_tests { + use lightcraft_raw::Opcode; + + use super::with_dng_lens_ops; + + fn same(v: &mut Vec) -> &mut Vec { + v + } + + /// Both tone fits of a DNG (the kept tone for a camera profile without a curve, and the starting colour) see its + /// lens opcodes restored and no embedded lens; the list is as it was afterwards (CodeRabbit on #1063: the + /// kept-tone fit ran without the opcodes and with the embedded lens). + #[test] + fn a_dngs_tone_fit_sees_its_lens_opcodes_and_no_embedded_lens() { + let vignette = Opcode::FixVignetteRadial { k: [0.1, 0.0, 0.0, 0.0, 0.0], center: [0.5, 0.5] }; + let ops = vec![vignette.clone()]; + let mut list: Vec = Vec::new(); + let lens = 7; + let seen = with_dng_lens_ops(&mut list, Some(&ops), Some(&lens), same, |l, embedded| (l.clone(), embedded.copied())); + assert_eq!(seen, (vec![vignette], None), "the opcodes are in, the embedded lens is not"); + assert!(list.is_empty(), "the list is as it was"); + let seen = with_dng_lens_ops(&mut list, None, Some(&lens), same, |l, embedded| (l.len(), embedded.copied())); + assert_eq!(seen, (0, Some(7)), "without DNG lens opcodes the embedded lens is used"); + } +} diff --git a/crates/engine/src/media/session.rs b/crates/engine/src/media/session.rs index 51dd720ad6e..508cbe1e448 100644 --- a/crates/engine/src/media/session.rs +++ b/crates/engine/src/media/session.rs @@ -106,10 +106,9 @@ impl crate::Session { let mut job = self.render_job(id, max_w, max_h, false, apply_crop)?; // the source as these settings develop it: another camera profile (or none) decodes anew let mut p = (**self.catalog.photo(id)?).clone(); - if self.media.camera_profile_of(&p).map(|c| c.0) != { - p.develop = Arc::new(settings.clone()); - self.media.camera_profile_of(&p).map(|c| c.0) - } { + let own_profile = self.media.camera_profile_of(&p).map(|c| c.0); + p.develop = Arc::new(settings.clone()); + if self.media.camera_profile_of(&p).map(|c| c.0) != own_profile { job.source = self.media.source_ref(&p, job.level); } job.settings = Arc::new(settings.clone()); From 5a3d647ebd7d7cdbb041270ae01a58a883b19041 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Wed, 28 Oct 2026 09:50:25 +1000 Subject: [PATCH 18/27] LR-PROF-IMPORT: a hover preview's key carries the camera profile file's fingerprint Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/media/session.rs | 10 +++++++++- crates/engine/src/tests/dcp.rs | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/media/session.rs b/crates/engine/src/media/session.rs index 508cbe1e448..dbb6d0e1261 100644 --- a/crates/engine/src/media/session.rs +++ b/crates/engine/src/media/session.rs @@ -112,7 +112,15 @@ impl crate::Session { job.source = self.media.source_ref(&p, job.level); } job.settings = Arc::new(settings.clone()); - job.key = settings.hash64() ^ ((max_w as u64) << 40) ^ ((max_h as u64) << 20) ^ (apply_crop as u64) ^ (job.level as u64) << 60; + // (the imported camera profile's file is in the key, as in `render_job`'s: a profile file replaced under the + // same id is a new picture) + let profile_salt = self.media.camera_profile_salt(&settings.profile.id); + job.key = settings.hash64() + ^ ((max_w as u64) << 40) + ^ ((max_h as u64) << 20) + ^ (apply_crop as u64) + ^ (job.level as u64) << 60 + ^ profile_salt.rotate_left(29); Some(job) } diff --git a/crates/engine/src/tests/dcp.rs b/crates/engine/src/tests/dcp.rs index 0df9eb5215c..9d9ead08df5 100644 --- a/crates/engine/src/tests/dcp.rs +++ b/crates/engine/src/tests/dcp.rs @@ -188,6 +188,11 @@ fn hover_previews_and_browser_thumbnails_decode_with_the_hovered_camera_profile( assert!(close(hover, selected), "{hover:?} vs {selected:?}"); let back = mean(s.preview_job(id, 64, 64, true, &own).unwrap()); assert!(close(back, builtin), "{back:?} vs {builtin:?}"); + // the profile's file replaced under the same id: the hover's key changes with it, so the old picture isn't + // taken for current (CodeRabbit on #1063) + let before = s.preview_job(id, 64, 64, true, &hovered).unwrap().key; + s.media.camera_profiles.get_mut(&dcp_id).unwrap().fingerprint ^= 0x10; + assert_ne!(s.preview_job(id, 64, 64, true, &hovered).unwrap().key, before); let _ = std::fs::remove_dir_all(&dir); } From 32d3a7e2ddd963c1245927dfb381a601d8fc8008 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Sun, 1 Nov 2026 03:19:41 +1000 Subject: [PATCH 19/27] LR-PROF-IMPORT: unusable camera profiles not offered; file's WB scale and the profile's tone kept Review of #1063 (CodeRabbit, outside-diff findings): - a camera profile whose file is missing or damaged when the library opens is no longer offered in the profile browser or accepted by develop.profile (it silently developed with the raw's own colour); the entry stays, so it is offered again once the file is back. - a raw on the relative white-balance scale stays relative with a camera profile (its matrices turned it to Kelvin, so existing edits were read as absolute temperatures and the catalog and quick previews disagreed). - with a camera profile its tone curve, then the tone kept for a curve-less profile, come before the fitted camera look's tone. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/dcp_profiles.rs | 3 +- crates/engine/src/cmd/develop.rs | 5 ++ crates/engine/src/files/load.rs | 74 ++++++++++++++++++++++++++- crates/engine/src/presets.rs | 12 +++-- crates/engine/src/tests/dcp.rs | 31 +++++++++++ 5 files changed, 119 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/dcp_profiles.rs b/crates/engine/src/cmd/dcp_profiles.rs index d253434c99f..f59dee06934 100644 --- a/crates/engine/src/cmd/dcp_profiles.rs +++ b/crates/engine/src/cmd/dcp_profiles.rs @@ -45,7 +45,8 @@ fn profiles_dir(s: &Session) -> Option { } /// Parse every imported camera profile again and hand them to the decoder (missing or damaged -/// files are skipped: photos using them develop with the file's own colour). +/// files are skipped: photos using them develop with the file's own colour, and the profile is not offered or +/// accepted by `develop.profile` until its file is back; the entry is kept). /// /// A library's own copies are found in `profiles`, the `Profiles/` folder of the library being opened (`None`: not on /// disk), wherever the saved path points: a library moved or restored elsewhere keeps its profiles (the saved path is diff --git a/crates/engine/src/cmd/develop.rs b/crates/engine/src/cmd/develop.rs index e7cbfa0d671..292ad27795a 100644 --- a/crates/engine/src/cmd/develop.rs +++ b/crates/engine/src/cmd/develop.rs @@ -563,6 +563,11 @@ pub fn specs() -> Vec { { return Err(bad("develop.profile", format!("unknown profile `{id}`"))); } + // an imported camera profile whose file is missing or damaged: choosing it would develop with the + // file's own colour without saying so + if crate::cmd::dcp_profiles::is_dcp_id(&id) && !s.media.camera_profiles.contains_key(&id) { + return Err(bad("develop.profile", format!("camera profile `{id}` can't be used: its file is missing or damaged"))); + } edit(s, "develop.profile", "Profile", |d| { d.profile.id = id.clone(); d.profile.amount = f64_or(p, "amount", d.profile.amount).clamp(0.0, 200.0); diff --git a/crates/engine/src/files/load.rs b/crates/engine/src/files/load.rs index 1ffa4055ba2..004723dca82 100644 --- a/crates/engine/src/files/load.rs +++ b/crates/engine/src/files/load.rs @@ -127,12 +127,20 @@ fn load_bytes_now( }; // An imported camera profile replaces the file's colour model (its matrices and look; the shot's white stays), so // the starting colour and the white balance scale below come from it, not from a fitted or built-in look. + // (the white balance stays on the scale the file and its camera give, the one the catalog's + // `Photo::relative_wb` and the quick previews use: a profile's matrices must not turn a relative white balance + // into Kelvin, which would read existing edits as absolute temperatures) + let own_scale = dcp.map(|_| WbScaleOf::new(raw.format, &raw.color, raw.wb_multipliers, &raw.metadata)); if let Some(p) = dcp { raw.color = p.applied_to(&raw.color); } // Which scale white balance is edited on, and the as-shot white on it, from the file's own colour tags or // the camera's measured matrices (`Photo::relative_wb` decides the same from the catalog's camera) let scale = WbScaleOf::new(raw.format, &raw.color, raw.wb_multipliers, &raw.metadata); + let scale = match &own_scale { + Some(own) => scale.keeping_classification_of(own), + None => scale, + }; // the source's segmentation mattes (DNG semantic masks), read while the starting colour is fitted let ((xy, t, camera_look), mattes) = rayon::join( || { @@ -216,8 +224,12 @@ fn load_bytes_now( let tags = lightcraft_raw::ColorData { profile: Default::default(), ..raw.color.clone() }; Arc::new(lightcraft_pipeline::CameraColor { tags, developed_for: xy }) }); - let camera_tone = - camera_look.as_ref().map(|p| p.tone).or_else(|| raw.color.profile.tone_curve.as_ref().and_then(dng_tone_curve)).or(kept_tone); + let camera_tone = camera_tone_of( + dcp.is_some(), + camera_look.as_ref().map(|p| p.tone), + raw.color.profile.tone_curve.as_ref().and_then(dng_tone_curve), + kept_tone, + ); let local_tone = local_tone(&raw); let (temp, tint) = scale.as_shot(xy); return Ok(( @@ -296,6 +308,13 @@ impl WbScaleOf { WbScaleOf { own_matrix, relative: fitted && !covered, legacy_relative: fitted && covered, scale_white, camera } } + /// This scale (a raw's, with an imported camera profile's colour model) on the white-balance scale `own` (the + /// same raw's with its own colour) gives: relative, or Kelvin edited on the relative scale before. The matrices, + /// and so the colour and the as-shot reading, stay this scale's. + pub(super) fn keeping_classification_of(self, own: &WbScaleOf) -> Self { + WbScaleOf { relative: own.relative, legacy_relative: own.legacy_relative, ..self } + } + /// What a DNG of this raw's camera RGB declares so that it shows the white balance as this scale does: the /// camera's measured matrices when they give the scale, else the white the scale shows at As Shot (the presets' /// reading; 6500 K / 0 on the relative scale; else `own`, the white the file's tags give). @@ -407,6 +426,57 @@ fn with_dng_lens_ops( out } +/// The tone a raw's starting look gets from its camera: `look` (the tone of the look fitted to the camera JPEG), +/// `curve` (the colour model's own tone curve: the file's, or with an imported camera profile, the profile's) and +/// `kept` (the photo's own tone, kept for a profile without a curve). With a camera profile (`profile`), its curve +/// comes first, then the kept tone, and the fitted look's only last: the look was fitted without the profile, so it +/// must not replace the profile's curve or the contrast kept for it. Without one, the fitted look leads as before. +fn camera_tone_of(profile: bool, look: Option, curve: Option, kept: Option) -> Option { + if profile { curve.or(kept).or(look) } else { look.or(curve).or(kept) } +} + +#[cfg(test)] +mod camera_tone_tests { + use super::camera_tone_of; + + /// CodeRabbit on #1063: with an imported camera profile, a fitted camera look's tone replaced the profile's own + /// tone curve and the tone kept for a profile without one. Without a profile the order is unchanged. + #[test] + fn a_camera_profiles_curve_and_kept_tone_come_before_the_fitted_look() { + assert_eq!(camera_tone_of(true, Some("look"), Some("profile"), Some("kept")), Some("profile")); + assert_eq!(camera_tone_of(true, Some("look"), None, Some("kept")), Some("kept")); + assert_eq!(camera_tone_of(true, Some("look"), None, None), Some("look")); + assert_eq!(camera_tone_of(false, Some("look"), Some("file"), Some("kept")), Some("look")); + assert_eq!(camera_tone_of(false, None, Some("file"), Some("kept")), Some("file")); + assert_eq!(camera_tone_of::<&str>(false, None, None, None), None); + } +} + +#[cfg(test)] +mod wb_scale_tests { + use super::WbScaleOf; + + /// CodeRabbit on #1063: a raw edited on the relative white-balance scale (no colour matrices, none measured for + /// its camera) turned to Kelvin once an imported camera profile's matrices replaced its colour, so its existing + /// edits (6500 K / 0 = as shot) were read as absolute temperatures, and the catalog and quick previews still + /// used the relative scale. The profile's matrices stay; the scale is the file's. + #[test] + fn a_camera_profile_keeps_a_relative_white_balance_relative() { + let format = lightcraft_raw::RawFormat::Cr3; + let meta = lightcraft_meta::Metadata::default(); + let own_color = lightcraft_raw::ColorData::default(); + let own = WbScaleOf::new(format, &own_color, Some([2.0, 1.0, 1.5]), &meta); + assert!(own.relative && !own.own_matrix, "a matrix-less raw of an unmeasured camera is relative"); + let m = lightcraft_color::Mat3([[0.9, 0.1, 0.0], [0.1, 0.8, 0.1], [0.0, 0.2, 0.8]]); + let profiled = lightcraft_raw::ColorData { illuminant: [21, 0], color_matrix: [Some(m), None], ..Default::default() }; + let with = WbScaleOf::new(format, &profiled, Some([2.0, 1.0, 1.5]), &meta); + assert!(!with.relative, "the profile's matrices alone would make it Kelvin"); + let kept = with.keeping_classification_of(&own); + assert!(kept.relative && !kept.legacy_relative && kept.own_matrix, "relative, with the profile's matrices"); + assert_eq!(kept.as_shot(lightcraft_color::Xy { x: 0.3127, y: 0.329 }), (6500.0, 0.0)); + } +} + #[cfg(test)] mod lens_ops_tests { use lightcraft_raw::Opcode; diff --git a/crates/engine/src/presets.rs b/crates/engine/src/presets.rs index 9c7c0260b97..582f9c5c41a 100644 --- a/crates/engine/src/presets.rs +++ b/crates/engine/src/presets.rs @@ -529,10 +529,16 @@ impl Session { self.dcp_profiles.iter().find(|p| p.id == id).map(|p| (p.name.as_str(), crate::cmd::dcp_profiles::DCP_GROUP)) } - /// The imported profiles as (id, name, group): LUT profiles, then camera profiles (`.dcp`). + /// The imported profiles as (id, name, group): LUT profiles, then camera profiles (`.dcp`). A camera profile + /// whose file is missing or damaged (not loaded when the library opened) is left out, so it can't be chosen; its + /// entry stays and it is offered again once the file is back. pub fn imported_profiles(&self) -> Vec<(String, String, String)> { let luts = self.lut_profiles.iter().map(|p| (p.id.clone(), p.name.clone(), p.group.clone())); - let dcps = self.dcp_profiles.iter().map(|p| (p.id.clone(), p.name.clone(), crate::cmd::dcp_profiles::DCP_GROUP.to_string())); + let dcps = self + .dcp_profiles + .iter() + .filter(|p| self.media.camera_profiles.contains_key(&p.id)) + .map(|p| (p.id.clone(), p.name.clone(), crate::cmd::dcp_profiles::DCP_GROUP.to_string())); luts.chain(dcps).collect() } @@ -565,7 +571,7 @@ impl Session { let mut lut_groups: Vec<&str> = self.lut_profiles.iter().map(|p| p.group.as_str()).collect(); lut_groups.sort_unstable(); lut_groups.dedup(); - if !self.dcp_profiles.is_empty() { + if imported.iter().any(|p| p.2 == crate::cmd::dcp_profiles::DCP_GROUP) { lut_groups.push(crate::cmd::dcp_profiles::DCP_GROUP); } lut_groups.dedup(); diff --git a/crates/engine/src/tests/dcp.rs b/crates/engine/src/tests/dcp.rs index 9d9ead08df5..4861f1f9d7b 100644 --- a/crates/engine/src/tests/dcp.rs +++ b/crates/engine/src/tests/dcp.rs @@ -488,3 +488,34 @@ fn deleting_a_profile_never_follows_dot_dot_out_of_the_profiles_folder() { assert!(outside.exists(), "the file outside the profiles folder stays"); let _ = std::fs::remove_dir_all(&dir); } + +/// CodeRabbit on #1063: a camera profile whose library copy is missing or damaged when the library opens stayed in the +/// profile browser and `develop.profile` accepted it, and the photo then silently developed with the raw's own +/// colour. It is no longer offered or accepted; its entry stays, and once the file is back it is offered again. +#[test] +fn a_damaged_camera_profile_is_not_offered_until_its_file_is_back() { + let dir = temp_dir("damaged"); + let (mut s, _id, dcp_id) = library_with_profile(&dir); + let file = std::path::PathBuf::from(&s.dcp_profiles[0].file); + s.persist().unwrap(); + s.close_library().unwrap(); + drop(s); + let good = std::fs::read(&file).unwrap(); + std::fs::write(&file, b"not a profile").unwrap(); + let mut s = Session::new().with_fs(); + s.open_library(dir.join("lib"), false).unwrap(); + assert_eq!(s.dcp_profiles.len(), 1, "the entry stays"); + assert!(!s.imported_profiles().iter().any(|p| p.0 == dcp_id), "not offered"); + let menu = s.profile_menu().to_string(); + assert!(!menu.contains(&dcp_id), "not in the profile menu: {menu}"); + assert!(s.execute("develop.profile", &json!({"id": dcp_id})).is_err(), "not accepted"); + s.close_library().unwrap(); + drop(s); + std::fs::write(&file, good).unwrap(); + let mut s = Session::new().with_fs(); + s.open_library(dir.join("lib"), false).unwrap(); + assert!(s.imported_profiles().iter().any(|p| p.0 == dcp_id), "offered again"); + s.execute("develop.profile", &json!({"id": dcp_id})).unwrap(); + s.close_library().unwrap(); + let _ = std::fs::remove_dir_all(&dir); +} From e074555c04d80f23b50fda3e82253eab12ec738b Mon Sep 17 00:00:00 2001 From: OneSlips Date: Sun, 1 Nov 2026 05:41:04 +1000 Subject: [PATCH 20/27] LR-PROF-IMPORT: one Camera Profiles group; the web loader keeps a raw's own colour Review of #1063 (CodeRabbit): - a LUT group named "Camera Profiles" that didn't sort last made the profile menu list that group twice; it is now one group, last, with both kinds. - without web workers a render ran inline and the web loader applied the selected camera profile, unlike the worker (the documented web behaviour keeps the raw's own colour); the loader now leaves it out. Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 2 + apps/lightcraft-web/Cargo.toml | 2 + apps/lightcraft-web/src/store.rs | 64 +++++++++++++++++++++++++++++++- crates/engine/src/presets.rs | 3 +- crates/engine/src/tests/dcp.rs | 25 +++++++++++++ 5 files changed, 93 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8063ed5a404..b0b87affa30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4013,9 +4013,11 @@ dependencies = [ "egui", "js-sys", "lightcraft-codecs", + "lightcraft-color", "lightcraft-engine", "lightcraft-preview", "lightcraft-raster", + "lightcraft-raw", "lightcraft-ui-egui", "log", "serde", diff --git a/apps/lightcraft-web/Cargo.toml b/apps/lightcraft-web/Cargo.toml index d4ae0f66744..a5732beeaaf 100644 --- a/apps/lightcraft-web/Cargo.toml +++ b/apps/lightcraft-web/Cargo.toml @@ -80,3 +80,5 @@ heif = ["lightcraft-codecs/heif"] [dev-dependencies] egui = { workspace = true } +lightcraft-color = { workspace = true } +lightcraft-raw = { workspace = true } diff --git a/apps/lightcraft-web/src/store.rs b/apps/lightcraft-web/src/store.rs index 96750ba6d95..8f7c8e28392 100644 --- a/apps/lightcraft-web/src/store.rs +++ b/apps/lightcraft-web/src/store.rs @@ -144,9 +144,11 @@ impl Originals { /// Engine hooks that decode/probe from memory. pub fn hooks(&self) -> (FileLoader, FileProbe) { let s = self.clone(); - let loader: FileLoader = Arc::new(move |path: &str, max_edge: usize, dcp: Option<&lightcraft_engine::media::DcpProfile>| { + // (an imported camera profile is not applied on the web, as in the render worker: a raw keeps its own colour, + // whether it decodes in a worker or inline when workers are unavailable) + let loader: FileLoader = Arc::new(move |path: &str, max_edge: usize, _dcp: Option<&lightcraft_engine::media::DcpProfile>| { let bytes = s.get(path).ok_or_else(|| format!("{path}: the original is still loading from browser storage"))?; - load_bytes_with(&bytes, max_edge, dcp) + load_bytes_with(&bytes, max_edge, None) }); let s = self.clone(); let probe: FileProbe = Arc::new(move |path: &str| { @@ -237,6 +239,64 @@ mod tests { assert_eq!(out.image.width, 20); } + /// CodeRabbit on #1063: without web workers a render runs inline and handed the selected camera profile to this + /// loader, which applied it, so the picture differed from the worker's (which keeps the raw's own colour, the + /// documented web behaviour). The loader now ignores it. + #[test] + fn the_web_loader_keeps_a_raws_own_colour_with_a_camera_profile() { + use lightcraft_raw::*; + let (w, h) = (32usize, 24usize); + let raw = RawImage { + format: RawFormat::Dng, + width: w, + height: h, + cpp: 1, + data: RawData::U16((0..w * h).map(|i| 256 + ((i % w) * 300 + (i / w) * 200) as u16).collect()), + cfa: Cfa::bayer("RGGB"), + bits: 14, + black: BlackLevel::uniform(256.0), + white: vec![16000.0], + active_area: Rect::new(0, 0, w, h), + crop: Rect::new(0, 0, w, h), + orientation: Orientation::Normal, + color: ColorData { + illuminant: [21, 0], + color_matrix: [Some(lightcraft_color::Mat3([[0.9, 0.2, -0.15], [-0.3, 1.25, 0.08], [0.02, -0.12, 0.85]])), None], + as_shot_neutral: Some([0.5, 1.0, 0.7]), + ..Default::default() + }, + wb_multipliers: None, + linearized: false, + pixel_aspect: 1.0, + opcodes: OpcodeLists::default(), + metadata: Default::default(), + lens_metadata: Default::default(), + }; + let dng = write_dng(&raw, &DngWriteOptions::default()).unwrap(); + // our own numbers: a matrix that swaps the camera's red and blue + let swap = lightcraft_color::Mat3([[0.0, 0.0, 1.0], [0.0, 1.0, 0.0], [1.0, 0.0, 0.0]]).mul(&lightcraft_color::Mat3([ + [3.2406, -1.5372, -0.4986], + [-0.9689, 1.8758, 0.0415], + [0.0557, -0.2040, 1.0570], + ])); + let profile = dcp::DcpProfile { + name: "Swap".into(), + camera_model: "LightCraft Test Camera".into(), + color: ColorData { illuminant: [21, 0], color_matrix: [Some(swap), None], ..Default::default() }, + }; + assert_ne!( + load_bytes_with(&dng, 64, Some(&profile)).unwrap().0.data, + load_bytes_with(&dng, 64, None).unwrap().0.data, + "the profile changes a raw's colour where it is applied" + ); + let store = Originals::default(); + store.insert("h1", Arc::from(dng)); + let (loader, _) = store.hooks(); + let with = loader("web/h1/a.dng", 64, Some(&profile)).unwrap(); + let without = loader("web/h1/a.dng", 64, None).unwrap(); + assert_eq!(with.0.data, without.0.data, "the web loader leaves it out"); + } + #[test] fn download_names() { assert_eq!(download_name("dir/x-lightcraft.png"), "x-lightcraft.png"); diff --git a/crates/engine/src/presets.rs b/crates/engine/src/presets.rs index 582f9c5c41a..9ce4c3e9166 100644 --- a/crates/engine/src/presets.rs +++ b/crates/engine/src/presets.rs @@ -571,10 +571,11 @@ impl Session { let mut lut_groups: Vec<&str> = self.lut_profiles.iter().map(|p| p.group.as_str()).collect(); lut_groups.sort_unstable(); lut_groups.dedup(); + // the camera profiles' group once, last (a LUT group of the same name joins it rather than showing twice) + lut_groups.retain(|g| *g != crate::cmd::dcp_profiles::DCP_GROUP); if imported.iter().any(|p| p.2 == crate::cmd::dcp_profiles::DCP_GROUP) { lut_groups.push(crate::cmd::dcp_profiles::DCP_GROUP); } - lut_groups.dedup(); for g in lut_groups { let profiles: Vec = imported.iter().filter(|p| p.2 == g).map(imported_item).collect(); groups.push(json!({"name": g, "profiles": profiles, "imported": true})); diff --git a/crates/engine/src/tests/dcp.rs b/crates/engine/src/tests/dcp.rs index 4861f1f9d7b..682e921c49a 100644 --- a/crates/engine/src/tests/dcp.rs +++ b/crates/engine/src/tests/dcp.rs @@ -519,3 +519,28 @@ fn a_damaged_camera_profile_is_not_offered_until_its_file_is_back() { s.close_library().unwrap(); let _ = std::fs::remove_dir_all(&dir); } + +/// CodeRabbit on #1063: a LUT profile group named like the camera profiles' ("Camera Profiles") that doesn't sort last +/// made the profile menu list that group twice, each with the same profiles. It is one group, last. +#[test] +fn a_lut_group_named_camera_profiles_joins_the_camera_profiles_group() { + let dir = temp_dir("group"); + let (mut s, _id, dcp_id) = library_with_profile(&dir); + for (id, group) in [("lut:a", crate::cmd::dcp_profiles::DCP_GROUP), ("lut:z", "Zebra")] { + s.lut_profiles.push(crate::cmd::lut_profiles::LutProfile { id: id.into(), name: id.into(), group: group.into(), file: String::new() }); + } + let menu = s.profile_menu(); + let groups: Vec<&str> = menu["groups"].as_array().unwrap().iter().filter_map(|g| g["name"].as_str()).collect(); + assert_eq!(groups.iter().filter(|g| **g == crate::cmd::dcp_profiles::DCP_GROUP).count(), 1, "{groups:?}"); + assert_eq!(groups.last(), Some(&crate::cmd::dcp_profiles::DCP_GROUP), "{groups:?}"); + let ids: Vec<&str> = menu["groups"] + .as_array() + .unwrap() + .iter() + .filter(|g| g["name"] == crate::cmd::dcp_profiles::DCP_GROUP) + .flat_map(|g| g["profiles"].as_array().unwrap().iter().filter_map(|p| p["id"].as_str())) + .collect(); + assert!(ids.contains(&"lut:a") && ids.contains(&dcp_id.as_str()), "{ids:?}"); + s.close_library().unwrap(); + let _ = std::fs::remove_dir_all(&dir); +} From b9937f7919a844204d26882b7ff318792b1b9af9 Mon Sep 17 00:00:00 2001 From: OneSlips Date: Sun, 1 Nov 2026 08:03:32 +1000 Subject: [PATCH 21/27] LR-PROF-IMPORT: camera profile files are read at most to the 64 MiB limit A .dcp larger than the parser accepts was read whole into memory before being refused. One bounded read (lightcraft_raw::dcp::read_dcp) stops one byte past the limit and is used for import, reopening a library and the duplicate check. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/dcp_profiles.rs | 13 +++++------ crates/engine/src/tests/dcp.rs | 17 +++++++++++++++ crates/raw/src/dcp.rs | 31 +++++++++++++++++++++++++-- 3 files changed, 53 insertions(+), 8 deletions(-) diff --git a/crates/engine/src/cmd/dcp_profiles.rs b/crates/engine/src/cmd/dcp_profiles.rs index f59dee06934..a7c6d4c02cf 100644 --- a/crates/engine/src/cmd/dcp_profiles.rs +++ b/crates/engine/src/cmd/dcp_profiles.rs @@ -62,7 +62,9 @@ pub fn register_all(s: &mut Session, profiles: Option<&Path>) { let loaded: Vec<(String, LoadedCameraProfile)> = s .dcp_profiles .iter() - .filter_map(|p| std::fs::read(&p.file).ok().and_then(|b| LoadedCameraProfile::parse(&b).ok()).map(|d| (p.id.clone(), d))) + .filter_map(|p| { + lightcraft_raw::dcp::read_dcp(Path::new(&p.file)).ok().and_then(|b| LoadedCameraProfile::parse(&b).ok()).map(|d| (p.id.clone(), d)) + }) .collect(); s.media.camera_profiles = loaded.into_iter().collect(); } @@ -101,7 +103,7 @@ pub fn import_files(s: &mut Session, paths: &[String]) -> Result<(Vec, Ve let (mut imported, mut failed) = (Vec::new(), Vec::new()); for f in dcp_files(paths) { let shown = f.display().to_string(); - let bytes = match std::fs::read(&f) { + let bytes = match lightcraft_raw::dcp::read_dcp(&f) { Ok(b) => b, Err(e) => { failed.push(json!([shown, e.to_string()])); @@ -119,10 +121,9 @@ pub fn import_files(s: &mut Session, paths: &[String]) -> Result<(Vec, Ve let stem = f.file_stem().map(|n| n.to_string_lossy().to_string()).unwrap_or_else(|| "Camera Profile".into()); let name = if profile.name.trim().is_empty() { stem.clone() } else { profile.name.trim().to_string() }; // the same profile imported again: keep the one there is - let same = s - .dcp_profiles - .iter() - .find(|p| p.name == name && p.camera_model == profile.camera_model && std::fs::read(&p.file).is_ok_and(|b| b == bytes)); + let same = s.dcp_profiles.iter().find(|p| { + p.name == name && p.camera_model == profile.camera_model && lightcraft_raw::dcp::read_dcp(Path::new(&p.file)).is_ok_and(|b| b == bytes) + }); if let Some(p) = same { imported.push(json!({"id": p.id, "name": p.name, "cameraModel": p.camera_model, "existing": true})); continue; diff --git a/crates/engine/src/tests/dcp.rs b/crates/engine/src/tests/dcp.rs index 682e921c49a..87f926f5915 100644 --- a/crates/engine/src/tests/dcp.rs +++ b/crates/engine/src/tests/dcp.rs @@ -544,3 +544,20 @@ fn a_lut_group_named_camera_profiles_joins_the_camera_profiles_group() { s.close_library().unwrap(); let _ = std::fs::remove_dir_all(&dir); } + +/// A `.dcp` file larger than the parser accepts is refused while it is read, before the whole file is loaded into +/// memory (CodeRabbit on #1063): the import reports it as failed with its own reason. +#[test] +fn an_oversized_camera_profile_is_refused_while_it_is_read() { + let dir = temp_dir("oversized"); + let big = dir.join("Big.dcp"); + let mut bytes = write_dcp(&swapping_profile("Big")).unwrap(); + bytes.truncate(4); + std::fs::write(&big, &bytes).unwrap(); + std::fs::OpenOptions::new().write(true).open(&big).unwrap().set_len(lightcraft_raw::dcp::MAX_DCP_BYTES + 1).unwrap(); + let mut s = Session::new(); + let r = s.execute("profile.import", &json!({"paths": [big.to_string_lossy()]})).unwrap(); + assert_eq!(r["imported"], json!([]), "{r}"); + assert_eq!(r["failed"][0][1], json!("the camera profile is larger than 64 MiB"), "{r}"); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/raw/src/dcp.rs b/crates/raw/src/dcp.rs index e9a1ea4eb95..3c2d05ba5f8 100644 --- a/crates/raw/src/dcp.rs +++ b/crates/raw/src/dcp.rs @@ -63,12 +63,27 @@ pub fn is_dcp(bytes: &[u8]) -> bool { matches!(bytes.get(0..4), Some([b'I', b'I', b'R', b'C'] | [b'M', b'M', b'C', b'R'])) } -/// Parse a `.dcp` file. Files above 64 MiB are refused (real profiles are kilobytes to a few MB). +/// The largest `.dcp` file read or parsed (real profiles are kilobytes to a few MB). +pub const MAX_DCP_BYTES: u64 = 64 << 20; + +/// Read the `.dcp` file at `path`, reading at most [`MAX_DCP_BYTES`] + 1 bytes: a larger file is refused +/// before it is loaded into memory. +pub fn read_dcp(path: &std::path::Path) -> std::io::Result> { + use std::io::Read; + let mut bytes = Vec::new(); + std::fs::File::open(path)?.take(MAX_DCP_BYTES.saturating_add(1)).read_to_end(&mut bytes)?; + if bytes.len() as u64 > MAX_DCP_BYTES { + return Err(std::io::Error::new(std::io::ErrorKind::InvalidData, "the camera profile is larger than 64 MiB")); + } + Ok(bytes) +} + +/// Parse a `.dcp` file. Files above 64 MiB ([`MAX_DCP_BYTES`]) are refused. pub fn parse_dcp(bytes: &[u8]) -> Result { if !is_dcp(bytes) { return Err(DcpError::NotDcp); } - if bytes.len() > 64 << 20 { + if bytes.len() as u64 > MAX_DCP_BYTES { return Err(DcpError::Damaged("larger than 64 MiB".into())); } // the TIFF reader only knows 42 / BigTIFF / raw magics: give it a header with 42 in place of RC @@ -160,6 +175,18 @@ pub fn write_dcp(p: &DcpProfile) -> Result, DcpError> { mod tests { use super::*; + #[test] + fn reading_a_profile_stops_past_the_size_limit() { + let dir = std::env::temp_dir().join(format!("lc-read-dcp-{}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let (fits, big) = (dir.join("fits.dcp"), dir.join("big.dcp")); + std::fs::File::create(&fits).unwrap().set_len(MAX_DCP_BYTES).unwrap(); + std::fs::File::create(&big).unwrap().set_len(MAX_DCP_BYTES + 1).unwrap(); + assert_eq!(read_dcp(&fits).unwrap().len() as u64, MAX_DCP_BYTES); + assert_eq!(read_dcp(&big).unwrap_err().kind(), std::io::ErrorKind::InvalidData); + let _ = std::fs::remove_dir_all(&dir); + } + /// A minimal single-illuminant profile (our own numbers) built in memory: no profile file is /// committed to the repository. pub(crate) fn synthetic_dcp(little: bool, with_hue_sat: bool) -> Vec { From 408636ab5fd5c564b9e1d9308e77cd7bf571006f Mon Sep 17 00:00:00 2001 From: OneSlips Date: Sun, 1 Nov 2026 21:35:42 +1000 Subject: [PATCH 22/27] LR-PROF-IMPORT: a test that a hostile hue/saturation map header in a camera profile drops the map (FredApps, #1063) Dimensions far past the data, past u32 products or zero, an entry count of 4 billion values and a data offset past the end each drop the map while the profile's matrix still reads. Co-Authored-By: Claude Opus 5.5 --- crates/raw/src/dcp.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/crates/raw/src/dcp.rs b/crates/raw/src/dcp.rs index 3c2d05ba5f8..774b1ceab17 100644 --- a/crates/raw/src/dcp.rs +++ b/crates/raw/src/dcp.rs @@ -281,6 +281,35 @@ mod tests { assert!(parse_dcp(&bad).is_err()); } + /// The hue/saturation map's header is the user's file too: dimensions far past the data, an entry count + /// claiming 4 billion values, or a data offset past the end drop the map (the matrix still reads) instead of + /// allocating for the claim or reading past the file. + #[test] + fn a_hostile_hue_sat_map_header_drops_the_map() { + let good = synthetic_dcp(true, true); + let at = |needle: &[u8]| good.windows(needle.len()).position(|w| w == needle).unwrap(); + let le = |v: &[u32]| v.iter().flat_map(|x| x.to_le_bytes()).collect::>(); + let dims = at(&le(&[2, 2, 1])); + // the map data's directory entry: tag, FLOAT, count 12, offset + let entry = at(&[t::PROFILE_HUE_SAT_MAP_DATA_1.to_le_bytes(), 11u16.to_le_bytes()].concat()); + let patched = |at: usize, bytes: &[u8]| { + let mut b = good.clone(); + b[at..at + bytes.len()].copy_from_slice(bytes); + b + }; + for (what, bytes) in [ + ("4096³ dimensions", patched(dims, &le(&[4096, 4096, 4096]))), + ("dimensions past u32 products", patched(dims, &le(&[u32::MAX, u32::MAX, u32::MAX]))), + ("a zero dimension", patched(dims, &le(&[0, 2, 1]))), + ("4 billion values", patched(entry + 4, &le(&[u32::MAX]))), + ("data past the end", patched(entry + 8, &le(&[u32::MAX - 16]))), + ] { + let p = parse_dcp(&bytes).unwrap_or_else(|e| panic!("{what}: {e:?}")); + assert!(p.color.profile.hue_sat_map[0].is_none(), "{what}: the map is dropped"); + assert!(p.color.color_matrix[0].is_some(), "{what}: the matrix still reads"); + } + } + #[test] fn written_profiles_read_back() { let p = parse_dcp(&synthetic_dcp(false, true)).unwrap(); From a864aadd98ea66ad2cc7d8a11f39e6abd15c4e6b Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Thu, 5 Nov 2026 04:52:16 +0100 Subject: [PATCH 23/27] Docs: parity checklist keeps both sides of the merge --- docs/parity-checklist.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 9d70a98c8fa..a0bda00162a 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -1,10 +1,6 @@ # Lightroom parity checklist -<<<<<<< HEAD -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (LR-PROF-IMPORT: the user's own .dcp camera profiles import, checked on a real D750 profile against Lightroom; LR-BEHAV-ACCESS: the Flatpak may talk to the accessibility bus; LR-LIB-ALBUM: album commands leave out photos the library no longer has and record nothing when they add nothing; LR-BEHAV-DRAGDROP: a right-click on a text field while photos are carried from the grid opens no Cut / Copy / Paste menu; LR-BEHAV-DRAGDROP: a right-click while photos are carried from the grid opens no context menu; LR-LIB-VIRTUALCOPY: default numbering is preflighted across the requested batch and explicit names bypass suffix allocation; LR-BEHAV-DRAGDROP: only the primary button drags photos out of the grid and drops them; KEYC-RATING: deleting a keyword while Enable Filters has the filter put aside no longer leaves an empty one there; LR-BEHAV-DRAGDROP: a drop's destination is named with its parent when another folder or album has the same name; LR-VIEW-FILMSTRIP: photos drag from the filmstrip to the same sidebar targets as from the grid; LRC-LIB-LIBFOLDERS: a deep row's count follows its name in a narrow panel; LR-FILT-FLAG / LRC-LIB-FILTERBAR: the flag toggles combine, Picked + Unflagged, #2588; LR-VIEW-PHOTOGRID, LR-VIEW-FILMSTRIP, LR-VIEW-COMPARE, LR-VIEW-SURVEY, LRC-LIB-REFVIEW, LRC-LIB-PEOPLE: the active photo's selection ring shows on light themes and in Compare, Survey and the face tiles, and needs a loaded thumbnail; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-META-LOCATION: Info GPS text is fully validated before metadata changes; LR-MAP-TRACKLOG decodes GPX character references in point fields; malformed references error; CDATA stays literal; LR-BEHAV-ACCESS: the Thumbnail size control is a slider to screen readers; LR-BEHAV-ACCESS: the Detail photo is named with its file name; LR-VIEW-PHOTOGRID: the grid's empty-view message names its shortcut as this platform writes it and as it is bound; LR-BEHAV-ACCESS: the grid's date headers are named as they read; LR-BEHAV-ACCESS: the sidebar's disclosure triangles name their row; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌘⌥⇧K Set Keyword Shortcut and ⇧K; KEYC-METADATA: ⌘⇧K / Ctrl+Shift+K Edit Keywords; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LRC-LIB-FOLDERS: Local's built-in places (Pictures, Desktop, Downloads, Home) offer no Rename Folder… or Move Folder To…, and `folder.rename` / `folder.move` refuse the home folder and its Pictures, Desktop and Downloads; LRC-LIB-CATALOG-SWITCH: a library's catalog.snap or folder given at launch opens that library; LR-IMP-ADD-DIALOG / LR-IMP-MOVE: checked rename-sequence exhaustion; LR-IMP-ADD-DIALOG: an import asks the disk about the probes a scan left, and for each photo's sidecar, up to 16 files at a time; LRC-LIB-LIBFOLDERS: Don't ask again in the Move Photos question is kept only when the move started; a refused move leaves the question on; LR-IMP-ADD-DIALOG: remembered import thumbnail size, density-aware bounded previews and one job per candidate/size bucket (#2237, part of #2056); import loupe remains open; counts unchanged; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-MERGE-HDR / LR-MERGE-PANO / LR-MERGE-HDRPANO: the dialog makes a new preview each time it opens, also after a failed one, #2708; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LRC-LIB-MISSING: `library.missing` from the control channel checks the files on a worker thread instead of the UI thread; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-CROP-AUTO: Auto straighten reads the vertical vanishing point and the horizon; LR-META-EXIF-FULL: reject extra EXIF clock components so invalid capture-time candidates fall through to valid metadata; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-META-XMP / LRC-MAP-TRACKLOG: malformed ISO times are not projected or matched; LR-IMP-FORMATS: JPEG ICC APP2 chunk validation; LR-BEHAV-TITLEBAR: a dialog leaves the title bar undimmed, as a macOS sheet does; LR-BEHAV-ACCESS: the bars are toolbars and the panels landmarks for screen readers; LR-BEHAV-ACCESS: every dialog and prompt is exposed as a dialog (a modal one, an alert dialog for the prompts); LR-BEHAV-ACCESS: icon-only buttons are named by their label, with the shortcut as the description; MENU-HELP-HELP: on macOS the Help menu is registered with the application only once the menu bar is installed (muda ignores the call before), so AppKit knows which menu is Help; LR-BEHAV-ACCESS: a slider's value field is named ` value`, with how to use it as its description; MENU-BAR: every shortcut the app shows on macOS lists its modifiers ⌃⌥⇧⌘, as the menu bar does; MENU-BAR: on macOS two menu rows that run the same command each get their own native row and label (File ▸ Export… and File ▸ Export with Preset ▸ Custom…; File ▸ New Album… and Photo ▸ Add to Album ▸ New Album…); LR-BEHAV-DIALOGS: a one-line prompt that is refused stays open and says why, and a New Folder on Disk says it was made; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-VIEW-HISTOGRAM: the shadow and highlight clipping buttons take their tile and chevron from the theme, so the chevron reads in every theme; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-MASK-BRUSH: extreme brush segments skip the intermediate dabs; LR-MASK-BRUSH: with the mask overlay hidden, the stroke being painted no longer tints the photo) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 -======= -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-02 · **Change:** minor (LRC-LIB-VISUALSEARCH: Find Similar Photos reads the photos on a worker thread, so a large library no longer freezes the window; LR-MASK-LINEAR: masks stay on the photo's content under lens corrections, Upright, Transform and Rotate; LR-IMP-FORMATS: the Canon CRW decoder is the shared craft-libs crate `craft-crw`; LR-PROF-CAMERACOLOR: chart-measured matrices for the Canon EOS D60, its white balance in Kelvin; CRW imports name their camera; LR-BEHAV-ACCESS: the Flatpak may talk to the accessibility bus; LR-LIB-ALBUM: album commands leave out photos the library no longer has and record nothing when they add nothing; LR-BEHAV-DRAGDROP: a right-click on a text field while photos are carried from the grid opens no Cut / Copy / Paste menu; LR-BEHAV-DRAGDROP: a right-click while photos are carried from the grid opens no context menu; LR-LIB-VIRTUALCOPY: default numbering is preflighted across the requested batch and explicit names bypass suffix allocation; LR-BEHAV-DRAGDROP: only the primary button drags photos out of the grid and drops them; KEYC-RATING: deleting a keyword while Enable Filters has the filter put aside no longer leaves an empty one there; LR-BEHAV-DRAGDROP: a drop's destination is named with its parent when another folder or album has the same name; LR-VIEW-FILMSTRIP: photos drag from the filmstrip to the same sidebar targets as from the grid; LRC-LIB-LIBFOLDERS: a deep row's count follows its name in a narrow panel; LR-FILT-FLAG / LRC-LIB-FILTERBAR: the flag toggles combine, Picked + Unflagged, #2588; LR-VIEW-PHOTOGRID, LR-VIEW-FILMSTRIP, LR-VIEW-COMPARE, LR-VIEW-SURVEY, LRC-LIB-REFVIEW, LRC-LIB-PEOPLE: the active photo's selection ring shows on light themes and in Compare, Survey and the face tiles, and needs a loaded thumbnail; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-META-LOCATION: Info GPS text is fully validated before metadata changes; LR-MAP-TRACKLOG decodes GPX character references in point fields; malformed references error; CDATA stays literal; LR-BEHAV-ACCESS: the Thumbnail size control is a slider to screen readers; LR-BEHAV-ACCESS: the Detail photo is named with its file name; LR-VIEW-PHOTOGRID: the grid's empty-view message names its shortcut as this platform writes it and as it is bound; LR-BEHAV-ACCESS: the grid's date headers are named as they read; LR-BEHAV-ACCESS: the sidebar's disclosure triangles name their row; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌘⌥⇧K Set Keyword Shortcut and ⇧K; KEYC-METADATA: ⌘⇧K / Ctrl+Shift+K Edit Keywords; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LRC-LIB-FOLDERS: Local's built-in places (Pictures, Desktop, Downloads, Home) offer no Rename Folder… or Move Folder To…, and `folder.rename` / `folder.move` refuse the home folder and its Pictures, Desktop and Downloads; LRC-LIB-CATALOG-SWITCH: a library's catalog.snap or folder given at launch opens that library; LR-IMP-ADD-DIALOG / LR-IMP-MOVE: checked rename-sequence exhaustion; LR-IMP-ADD-DIALOG: an import asks the disk about the probes a scan left, and for each photo's sidecar, up to 16 files at a time; LRC-LIB-LIBFOLDERS: Don't ask again in the Move Photos question is kept only when the move started; a refused move leaves the question on; LR-IMP-ADD-DIALOG: remembered import thumbnail size, density-aware bounded previews and one job per candidate/size bucket (#2237, part of #2056); import loupe remains open; counts unchanged; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-MERGE-HDR / LR-MERGE-PANO / LR-MERGE-HDRPANO: the dialog makes a new preview each time it opens, also after a failed one, #2708; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LRC-LIB-MISSING: `library.missing` from the control channel checks the files on a worker thread instead of the UI thread; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-CROP-AUTO: Auto straighten reads the vertical vanishing point and the horizon; LR-META-EXIF-FULL: reject extra EXIF clock components so invalid capture-time candidates fall through to valid metadata; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-META-XMP / LRC-MAP-TRACKLOG: malformed ISO times are not projected or matched; LR-IMP-FORMATS: JPEG ICC APP2 chunk validation; LR-BEHAV-TITLEBAR: a dialog leaves the title bar undimmed, as a macOS sheet does; LR-BEHAV-ACCESS: the bars are toolbars and the panels landmarks for screen readers; LR-BEHAV-ACCESS: every dialog and prompt is exposed as a dialog (a modal one, an alert dialog for the prompts); LR-BEHAV-ACCESS: icon-only buttons are named by their label, with the shortcut as the description; MENU-HELP-HELP: on macOS the Help menu is registered with the application only once the menu bar is installed (muda ignores the call before), so AppKit knows which menu is Help; LR-BEHAV-ACCESS: a slider's value field is named ` value`, with how to use it as its description; MENU-BAR: every shortcut the app shows on macOS lists its modifiers ⌃⌥⇧⌘, as the menu bar does; MENU-BAR: on macOS two menu rows that run the same command each get their own native row and label (File ▸ Export… and File ▸ Export with Preset ▸ Custom…; File ▸ New Album… and Photo ▸ Add to Album ▸ New Album…); LR-BEHAV-DIALOGS: a one-line prompt that is refused stays open and says why, and a New Folder on Disk says it was made; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-VIEW-HISTOGRAM: the shadow and highlight clipping buttons take their tile and chevron from the theme, so the chevron reads in every theme; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-MASK-BRUSH: extreme brush segments skip the intermediate dabs; LR-MASK-BRUSH: with the mask overlay hidden, the stroke being painted no longer tints the photo) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 ->>>>>>> origin/main +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-05 · **Change:** minor (LR-PROF-IMPORT: the user's own .dcp camera profiles import, checked on a real D750 profile against Lightroom; before: LRC-LIB-VISUALSEARCH: Find Similar Photos reads the photos on a worker thread, so a large library no longer freezes the window; LR-MASK-LINEAR: masks stay on the photo's content under lens corrections, Upright, Transform and Rotate; LR-IMP-FORMATS: the Canon CRW decoder is the shared craft-libs crate `craft-crw`; LR-PROF-CAMERACOLOR: chart-measured matrices for the Canon EOS D60, its white balance in Kelvin; CRW imports name their camera; LR-BEHAV-ACCESS: the Flatpak may talk to the accessibility bus; LR-LIB-ALBUM: album commands leave out photos the library no longer has and record nothing when they add nothing; LR-BEHAV-DRAGDROP: a right-click on a text field while photos are carried from the grid opens no Cut / Copy / Paste menu; LR-BEHAV-DRAGDROP: a right-click while photos are carried from the grid opens no context menu; LR-LIB-VIRTUALCOPY: default numbering is preflighted across the requested batch and explicit names bypass suffix allocation; LR-BEHAV-DRAGDROP: only the primary button drags photos out of the grid and drops them; KEYC-RATING: deleting a keyword while Enable Filters has the filter put aside no longer leaves an empty one there; LR-BEHAV-DRAGDROP: a drop's destination is named with its parent when another folder or album has the same name; LR-VIEW-FILMSTRIP: photos drag from the filmstrip to the same sidebar targets as from the grid; LRC-LIB-LIBFOLDERS: a deep row's count follows its name in a narrow panel; LR-FILT-FLAG / LRC-LIB-FILTERBAR: the flag toggles combine, Picked + Unflagged, #2588; LR-VIEW-PHOTOGRID, LR-VIEW-FILMSTRIP, LR-VIEW-COMPARE, LR-VIEW-SURVEY, LRC-LIB-REFVIEW, LRC-LIB-PEOPLE: the active photo's selection ring shows on light themes and in Compare, Survey and the face tiles, and needs a loaded thumbnail; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-META-LOCATION: Info GPS text is fully validated before metadata changes; LR-MAP-TRACKLOG decodes GPX character references in point fields; malformed references error; CDATA stays literal; LR-BEHAV-ACCESS: the Thumbnail size control is a slider to screen readers; LR-BEHAV-ACCESS: the Detail photo is named with its file name; LR-VIEW-PHOTOGRID: the grid's empty-view message names its shortcut as this platform writes it and as it is bound; LR-BEHAV-ACCESS: the grid's date headers are named as they read; LR-BEHAV-ACCESS: the sidebar's disclosure triangles name their row; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌘⌥⇧K Set Keyword Shortcut and ⇧K; KEYC-METADATA: ⌘⇧K / Ctrl+Shift+K Edit Keywords; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LRC-LIB-FOLDERS: Local's built-in places (Pictures, Desktop, Downloads, Home) offer no Rename Folder… or Move Folder To…, and `folder.rename` / `folder.move` refuse the home folder and its Pictures, Desktop and Downloads; LRC-LIB-CATALOG-SWITCH: a library's catalog.snap or folder given at launch opens that library; LR-IMP-ADD-DIALOG / LR-IMP-MOVE: checked rename-sequence exhaustion; LR-IMP-ADD-DIALOG: an import asks the disk about the probes a scan left, and for each photo's sidecar, up to 16 files at a time; LRC-LIB-LIBFOLDERS: Don't ask again in the Move Photos question is kept only when the move started; a refused move leaves the question on; LR-IMP-ADD-DIALOG: remembered import thumbnail size, density-aware bounded previews and one job per candidate/size bucket (#2237, part of #2056); import loupe remains open; counts unchanged; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-MERGE-HDR / LR-MERGE-PANO / LR-MERGE-HDRPANO: the dialog makes a new preview each time it opens, also after a failed one, #2708; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LRC-LIB-MISSING: `library.missing` from the control channel checks the files on a worker thread instead of the UI thread; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-CROP-AUTO: Auto straighten reads the vertical vanishing point and the horizon; LR-META-EXIF-FULL: reject extra EXIF clock components so invalid capture-time candidates fall through to valid metadata; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-META-XMP / LRC-MAP-TRACKLOG: malformed ISO times are not projected or matched; LR-IMP-FORMATS: JPEG ICC APP2 chunk validation; LR-BEHAV-TITLEBAR: a dialog leaves the title bar undimmed, as a macOS sheet does; LR-BEHAV-ACCESS: the bars are toolbars and the panels landmarks for screen readers; LR-BEHAV-ACCESS: every dialog and prompt is exposed as a dialog (a modal one, an alert dialog for the prompts); LR-BEHAV-ACCESS: icon-only buttons are named by their label, with the shortcut as the description; MENU-HELP-HELP: on macOS the Help menu is registered with the application only once the menu bar is installed (muda ignores the call before), so AppKit knows which menu is Help; LR-BEHAV-ACCESS: a slider's value field is named ` value`, with how to use it as its description; MENU-BAR: every shortcut the app shows on macOS lists its modifiers ⌃⌥⇧⌘, as the menu bar does; MENU-BAR: on macOS two menu rows that run the same command each get their own native row and label (File ▸ Export… and File ▸ Export with Preset ▸ Custom…; File ▸ New Album… and Photo ▸ Add to Album ▸ New Album…); LR-BEHAV-DIALOGS: a one-line prompt that is refused stays open and says why, and a New Folder on Disk says it was made; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-VIEW-HISTOGRAM: the shadow and highlight clipping buttons take their tile and chevron from the theme, so the chevron reads in every theme; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-MASK-BRUSH: extreme brush segments skip the intermediate dabs; LR-MASK-BRUSH: with the mask overlay hidden, the stroke being painted no longer tints the photo) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 The measured, row-by-row checklist: one row per Lightroom feature, menu item and shortcut, what we have and what is missing. It answers *does the feature exist?* (feature breadth). Whether it is good @@ -240,11 +236,8 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts). | LR-PROF-ADOBE | Standard raw looks (own equivalents) | P0 | ✅ | `crates/engine/src/presets.rs` (`PROFILES`), `crates/pipeline/src/profiles.rs` | six own looks: Color, Neutral, Vivid, Landscape, Portrait, Monochrome | | LR-PROF-ADAPTIVE | Adaptive profiles | P2 | ⬜ | | | | LR-PROF-CAMERA | Camera-matching looks | P2 | ⬜ | | | -<<<<<<< HEAD | LR-PROF-CAMERACOLOR | Camera colour calibration (own) | P0 | 🟡 | `crates/raw/src/color.rs`, `crates/raw/src/profile.rs`, `crates/raw/src/gaintable.rs`, `crates/engine/src/camera_preview.rs` | DNG files use the colour matrices and the camera-profile look they carry (`ProfileHueSatMap`, `ProfileLookTable`, `ProfileToneCurve`, read from the file at run time per DNG spec ch. 6 — Lightroom-converted DNGs rendered flat and muted without them, issue #138). A DNG whose profile defines no tone curve (absent or identity `ProfileToneCurve`, with or without a `LookTable`, as Adobe Standard in Lightroom-written DNGs) gets its tone fitted to its embedded preview when that is at least 10% of the raw's long edge and 384 px (Lightroom's 1024 px previews qualify): two Lightroom Classic 15.1 lossy ILCE-7CM2 DNGs went from about 0.8 EV darker and flat to within 3% of Lightroom's mean linear RGB. A DNG's `ProfileGainTableMap` / `ProfileGainTableMap2` (Apple ProRAW's local tone map; both versions, DNG 1.7 precedence, the file's byte order with a big-endian fallback) is read and written back by DNG export and not rendered by default, as Lightroom Classic renders ProRAW without it (measured on one CC0 iPhone 12 Pro ProRAW); the Profile option "Camera local tone mapping" (`profile.camera_local_tone`, per photo, off by default, `crates/pipeline/src/local_tone.rs`) renders it as the camera does, per output pixel in the scene-linear stage (CPU, also under the GPU path); Sony ARW, Nikon NEF, Panasonic RW2, Fujifilm RAF, Canon CR3 and CR2, Pentax PEF, Samsung SRW and Olympus ORF get a guarded file-local fit to their own embedded JPEG — chromaticity matrix + hue/saturation/value table + tone and chroma curves, relative WB — or, with a bundled or local per-model profile pooled from many photos (`lightcraft-cli calibrate`, ARW, NEF and RAF so far, `crates/engine/src/camera_profiles.rs`), the profile's colour and only their own tone/chroma curves (on 29 held-out ILCE-7M4 photos mean ΔE vs the camera JPEG 3.54 → 3.10; bundled ILCE-7CR from 125 photos: 26 held-out 4.07 → 3.29, and every one of the 131 photos accepted, 8 of which fell back to neutral without it; bundled ILCA-99M2 from 144 photos: 30 held-out 5.11 → 4.87, 25 of them closer); the tone fit also uses dark JPEG samples excluded from colour training, so deep shadows follow the camera toe (#1307); near-black frames with too few colour pairs can take a guarded tone-only fallback on their existing source colour (#1587); Sony ARWs shot with DRO on (maker note `0xb025`, on by default) keep that colour but their tone curve is lowered to Sony's curve without DRO, whose lifted shadows are in the camera JPEG only (issue #244: 8 ILCE-7CR photos +6.4 → +0.8 L* from Lightroom's default, median ΔE 7.5 → 3.3); 52 models without a profile whose JPEG fit fails (or that have no usable JPEG) start from DNG-style matrices fitted to their measured spectral sensitivities instead of the neutral fallback (`crates/raw/src/spectral.rs`, rawtoaces-data v1.1.0, Apache-2.0, aliases included; not yet measured against the camera JPEG); ARW: on 10 public raw.pixls.us samples from 8 bodies 7 fits were accepted, mean ΔE vs the camera JPEG 17–26 → 3–10; NEF: 13 of 13 decodable samples (D750, D780, D850, D7500, Z 50 and local D7500 shots) accepted, ΔE 13–46 → 3–8 (issue #150); RW2 / RWL: 140 of 174 public samples accepted, from 93 of the 114 bodies with a preview, median ΔE 5.0 with matching lightness (13 of the 14 corpus files with a preview: ΔE 9.6–27 → 2.8–8.9; most rejections are compacts and kit zooms whose camera JPEG is distortion-corrected); a fit that fails the gates on all pixels is retried away from edges, where a lens-corrected camera JPEG still lines up (issue #232: the six distortion-corrected public ILCE-7RM2 samples ΔE 16.6–16.9 → 3.7–3.8, the corpus GX80 19.1 → 7.9); RAF: bundled X-H2S/X-T4 profiles from 201/545 photos; on 150 withheld files mean ΔE improves slightly over per-file fitting (X-H2S 1.70 → 1.62, X-T4 2.43 → 2.34); 23 of 24 references from 13 bodies accepted, including the dark X-H2S samples (8.74 → 2.25); ORF: the 3 decodable corpus files (E-1, E-400, XZ-2) accepted (`docs/camera-preview-colour.md`); a raw whose camera JPEG is black and white (a monochrome picture style) takes only the JPEG's tone curve, on the camera profile's, spectral or neutral colour (issue #577); this is not measured camera calibration; other raws and rejected fits use a neutral fallback (camera RGB ≈ linear sRGB, `matrix_is_fallback`) with as-shot white balance, so colours are muted and not accurate. Needs our own per-camera calibration: matrices the files carry themselves (e.g. Olympus `ColorMatrix`), fitting each camera to its own embedded JPEG, then chart shots. Adobe matrices / DCPs are never shipped or used (a user can import their own `.dcp`, LR-PROF-IMPORT). Biggest image-quality gap today; ILCE-7RM6: per-file fit now runs on previews above 64 MP, a pooled profile (46 photos) was tried and not bundled (withheld ΔE 5.71 → 6.40, 11 of 15 regressed), kept with smart previews (see docs/camera-preview-colour.md); the fit pairs the sensor moved into the file's lens-warp geometry when that lines up better with a lens-corrected camera JPEG (29 CC0 raws: alignment +0.13, mean ΔE 3.73 → 3.61); bundled NIKON Z 6_2 profile (296 photos; 59 held-back photos mean ΔE 2.73 → 2.54) NIKON Z 8 profile (261 photos; 55 held back 2.55 → 2.33) and NIKON D5300 profile (264 photos; 53 held back 2.86 → 2.66) | -======= | LR-PROF-CAMERACOLOR | Camera colour calibration (own) | P0 | 🟡 | `crates/raw/src/color.rs`, `crates/raw/src/profile.rs`, `crates/raw/src/gaintable.rs`, `crates/engine/src/camera_preview.rs` | DNG files use the colour matrices and the camera-profile look they carry (`ProfileHueSatMap`, `ProfileLookTable`, `ProfileToneCurve`, read from the file at run time per DNG spec ch. 6 — Lightroom-converted DNGs rendered flat and muted without them, issue #138). A DNG whose profile defines no tone curve (absent or identity `ProfileToneCurve`, with or without a `LookTable`, as Adobe Standard in Lightroom-written DNGs) gets its tone fitted to its embedded preview when that is at least 10% of the raw's long edge and 384 px (Lightroom's 1024 px previews qualify): two Lightroom Classic 15.1 lossy ILCE-7CM2 DNGs went from about 0.8 EV darker and flat to within 3% of Lightroom's mean linear RGB. A DNG's `ProfileGainTableMap` / `ProfileGainTableMap2` (Apple ProRAW's local tone map; both versions, DNG 1.7 precedence, the file's byte order with a big-endian fallback) is read and written back by DNG export and not rendered by default, as Lightroom Classic renders ProRAW without it (measured on one CC0 iPhone 12 Pro ProRAW); the Profile option "Camera local tone mapping" (`profile.camera_local_tone`, per photo, off by default, `crates/pipeline/src/local_tone.rs`) renders it as the camera does, per output pixel in the scene-linear stage (CPU, also under the GPU path); Sony ARW, Nikon NEF, Panasonic RW2, Fujifilm RAF, Canon CR3 and CR2, Pentax PEF, Samsung SRW and Olympus ORF get a guarded file-local fit to their own embedded JPEG — chromaticity matrix + hue/saturation/value table + tone and chroma curves, relative WB — or, with a bundled or local per-model profile pooled from many photos (`lightcraft-cli calibrate`, ARW, NEF and RAF so far, `crates/engine/src/camera_profiles.rs`), the profile's colour and only their own tone/chroma curves (on 29 held-out ILCE-7M4 photos mean ΔE vs the camera JPEG 3.54 → 3.10; bundled ILCE-7CR from 125 photos: 26 held-out 4.07 → 3.29, and every one of the 131 photos accepted, 8 of which fell back to neutral without it; bundled ILCA-99M2 from 144 photos: 30 held-out 5.11 → 4.87, 25 of them closer); the tone fit also uses dark JPEG samples excluded from colour training, so deep shadows follow the camera toe (#1307); near-black frames with too few colour pairs can take a guarded tone-only fallback on their existing source colour (#1587); Sony ARWs shot with DRO on (maker note `0xb025`, on by default) keep that colour but their tone curve is lowered to Sony's curve without DRO, whose lifted shadows are in the camera JPEG only (issue #244: 8 ILCE-7CR photos +6.4 → +0.8 L* from Lightroom's default, median ΔE 7.5 → 3.3); 52 models without a profile whose JPEG fit fails (or that have no usable JPEG) start from DNG-style matrices fitted to their measured spectral sensitivities instead of the neutral fallback (`crates/raw/src/spectral.rs`, rawtoaces-data v1.1.0, Apache-2.0, aliases included; not yet measured against the camera JPEG); the Canon EOS D60 (CRW) has DNG-style matrices of our own, fitted to ColorChecker Classic shots under a tungsten bulb and direct sun (`crates/raw/src/chart_table.rs`, `clean-room/crw/10-chart-calibration.md`; CIEDE2000 on the chart mean 2.4 / 1.7, 2.7 / 2.0 leaving each patch out), which give its white balance a Kelvin scale (the camera's own presets read Tungsten 3,264 K, Daylight 5,603 K, Cloudy 6,612 K) while its look stays the JPEG fit; ARW: on 10 public raw.pixls.us samples from 8 bodies 7 fits were accepted, mean ΔE vs the camera JPEG 17–26 → 3–10; NEF: 13 of 13 decodable samples (D750, D780, D850, D7500, Z 50 and local D7500 shots) accepted, ΔE 13–46 → 3–8 (issue #150); RW2 / RWL: 140 of 174 public samples accepted, from 93 of the 114 bodies with a preview, median ΔE 5.0 with matching lightness (13 of the 14 corpus files with a preview: ΔE 9.6–27 → 2.8–8.9; most rejections are compacts and kit zooms whose camera JPEG is distortion-corrected); a fit that fails the gates on all pixels is retried away from edges, where a lens-corrected camera JPEG still lines up (issue #232: the six distortion-corrected public ILCE-7RM2 samples ΔE 16.6–16.9 → 3.7–3.8, the corpus GX80 19.1 → 7.9); RAF: bundled X-H2S/X-T4 profiles from 201/545 photos; on 150 withheld files mean ΔE improves slightly over per-file fitting (X-H2S 1.70 → 1.62, X-T4 2.43 → 2.34); 23 of 24 references from 13 bodies accepted, including the dark X-H2S samples (8.74 → 2.25); ORF: the 3 decodable corpus files (E-1, E-400, XZ-2) accepted (`docs/camera-preview-colour.md`); a raw whose camera JPEG is black and white (a monochrome picture style) takes only the JPEG's tone curve, on the camera profile's, spectral or neutral colour (issue #577); this is not measured camera calibration; other raws and rejected fits use a neutral fallback (camera RGB ≈ linear sRGB, `matrix_is_fallback`) with as-shot white balance, so colours are muted and not accurate. Needs our own per-camera calibration: matrices the files carry themselves (e.g. Olympus `ColorMatrix`), fitting each camera to its own embedded JPEG, then chart shots. Adobe matrices / DCPs are never used. Biggest image-quality gap today; ILCE-7RM6: per-file fit now runs on previews above 64 MP, a pooled profile (46 photos) was tried and not bundled (withheld ΔE 5.71 → 6.40, 11 of 15 regressed), kept with smart previews (see docs/camera-preview-colour.md); the fit pairs the sensor moved into the file's lens-warp geometry when that lines up better with a lens-corrected camera JPEG (29 CC0 raws: alignment +0.13, mean ΔE 3.73 → 3.61); bundled NIKON Z 6_2 profile (296 photos; 59 held-back photos mean ΔE 2.73 → 2.54) NIKON Z 8 profile (261 photos; 55 held back 2.55 → 2.33) and NIKON D5300 profile (264 photos; 53 held back 2.86 → 2.66) | ->>>>>>> origin/main | LR-PROF-CREATIVE | Creative profiles (own) | P2 | ✅ | `cmd:develop.profile`, `crates/pipeline/src/profiles.rs` | 16 own looks in Film / Cinematic / Muted / B&W (tone + point-curve fades, colour grading, mixer / B&W mix); scale with `ctl:profile.amount`; sliders untouched | | LR-PROF-LEGACY | Legacy profiles | P2 | ⬜ | | | | LR-PROF-NONRAW | Profiles for non-raw files | P0 | ✅ | `cmd:develop.profile` | same looks apply to JPEG/TIFF | From b295a557229f1342131b1df70636e58d76704403 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Thu, 5 Nov 2026 04:58:27 +0100 Subject: [PATCH 24/27] LR-PROF-IMPORT: tests added on main take the file loader's camera-profile argument --- crates/engine/src/cmd/similar.rs | 2 +- crates/engine/src/media/thumbnail_hash_tests.rs | 2 +- crates/ui-egui/src/tests/find_similar.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/similar.rs b/crates/engine/src/cmd/similar.rs index b8af1b24940..fd608ac2b7d 100644 --- a/crates/engine/src/cmd/similar.rs +++ b/crates/engine/src/cmd/similar.rs @@ -232,7 +232,7 @@ mod tests { s.catalog.apply(Op::AddPhoto { photo: Box::new(p) }).unwrap(); } let seen = files.clone(); - s.media.file_loader = Some(Arc::new(move |path: &str, _| { + s.media.file_loader = Some(Arc::new(move |path: &str, _, _| { let started = { let mut reads = seen.reads.lock().unwrap(); *reads.entry(path.to_string()).or_default() += 1; diff --git a/crates/engine/src/media/thumbnail_hash_tests.rs b/crates/engine/src/media/thumbnail_hash_tests.rs index 7a39bbb0ff0..ae6e0ef4728 100644 --- a/crates/engine/src/media/thumbnail_hash_tests.rs +++ b/crates/engine/src/media/thumbnail_hash_tests.rs @@ -94,7 +94,7 @@ fn source_from_before_content_reload_is_not_accepted() { #[test] fn source_from_before_a_lens_profile_change_is_not_accepted() { let mut s = session(); - s.media.file_loader = Some(Arc::new(|_, _| Ok((Rgb32f::new(8, 8), SourceInfo::default())))); + s.media.file_loader = Some(Arc::new(|_, _, _| Ok((Rgb32f::new(8, 8), SourceInfo::default())))); let old = s.thumb_job(PhotoId(1), 256).unwrap().run(); assert!(old.loaded.is_some()); let lens = lightcraft_develop::EmbeddedLens { source: lightcraft_develop::LensSource::Database, ..Default::default() }; diff --git a/crates/ui-egui/src/tests/find_similar.rs b/crates/ui-egui/src/tests/find_similar.rs index 4ac537dc281..b75995a1ca0 100644 --- a/crates/ui-egui/src/tests/find_similar.rs +++ b/crates/ui-egui/src/tests/find_similar.rs @@ -40,7 +40,7 @@ fn app_on_a_slow_drive(guard: Duration) -> (Headless, Drive) { let drive = Drive { open: Arc::new(AtomicBool::new(false)), reads: Arc::new(AtomicUsize::new(0)), on_ui: Arc::new(AtomicUsize::new(0)) }; let (ui, open, reads, on_ui) = (std::thread::current().id(), drive.open.clone(), drive.reads.clone(), drive.on_ui.clone()); let deadline = Instant::now() + guard; - app.session.media.file_loader = Some(Arc::new(move |path: &str, _| { + app.session.media.file_loader = Some(Arc::new(move |path: &str, _, _| { // (the grid reads the photos for its thumbnails too, on threads of its own) let thread = std::thread::current(); if thread.name().is_some_and(|n| n.starts_with("similar-") || n.contains(LABEL)) { @@ -195,7 +195,7 @@ fn a_search_that_cannot_start_leaves_no_row() { #[test] fn a_photo_that_cannot_be_read_says_so() { let (mut h, _) = app_on_a_slow_drive(Duration::ZERO); - h.app.session.media.file_loader = Some(Arc::new(|path: &str, _| Err(format!("{path}: gone")))); + h.app.session.media.file_loader = Some(Arc::new(|path: &str, _, _| Err(format!("{path}: gone")))); h.app.run("library.findSimilar", json!({"id": 1})).unwrap(); until_done(&mut h); let toast = h.app.ui.toast.as_ref().map(|t| t.0.clone()).unwrap_or_default(); From 9f8b3f537cb6e2c75bfdd7d5ebc2527dedafbeed Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Thu, 5 Nov 2026 05:31:43 +0100 Subject: [PATCH 25/27] Merge main; a thumbnail test takes the file loader's camera-profile argument --- crates/ui-egui/src/render/thumbnail_tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/render/thumbnail_tests.rs b/crates/ui-egui/src/render/thumbnail_tests.rs index c1d0859d5a7..7a2cb1a6a9a 100644 --- a/crates/ui-egui/src/render/thumbnail_tests.rs +++ b/crates/ui-egui/src/render/thumbnail_tests.rs @@ -83,7 +83,7 @@ fn each_render_request_and_how_it_ended_is_a_debug_line_with_its_file() { // a file that fails asks nothing while its failure stands, and says so when it is asked again let (mut app, work, ctx) = fixture(); - app.session.media.file_loader = Some(Arc::new(|_, _| Err("simulated decode failure".into()))); + app.session.media.file_loader = Some(Arc::new(|_, _, _| Err("simulated decode failure".into()))); let j = job(&mut app, 64); app.renderer.request(slot, j, 10); let (_, j) = take_job(&work); From ed7508f9dade216a1d403a6b85c8757ebb8d1e0c Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Thu, 5 Nov 2026 06:06:35 +0100 Subject: [PATCH 26/27] Docs: one camera colour row, with main's notes and the import note --- docs/parity-checklist.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index f154e90f54d..8bd0b6a254e 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -236,8 +236,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts). | LR-PROF-ADOBE | Standard raw looks (own equivalents) | P0 | ✅ | `crates/engine/src/presets.rs` (`PROFILES`), `crates/pipeline/src/profiles.rs` | six own looks: Color, Neutral, Vivid, Landscape, Portrait, Monochrome | | LR-PROF-ADAPTIVE | Adaptive profiles | P2 | ⬜ | | | | LR-PROF-CAMERA | Camera-matching looks | P2 | ⬜ | | | -| LR-PROF-CAMERACOLOR | Camera colour calibration (own) | P0 | 🟡 | `crates/raw/src/color.rs`, `crates/raw/src/profile.rs`, `crates/raw/src/gaintable.rs`, `crates/engine/src/camera_preview.rs` | DNG files use the colour matrices and the camera-profile look they carry (`ProfileHueSatMap`, `ProfileLookTable`, `ProfileToneCurve`, read from the file at run time per DNG spec ch. 6 — Lightroom-converted DNGs rendered flat and muted without them, issue #138). A DNG whose profile defines no tone curve (absent or identity `ProfileToneCurve`, with or without a `LookTable`, as Adobe Standard in Lightroom-written DNGs) gets its tone fitted to its embedded preview when that is at least 10% of the raw's long edge and 384 px (Lightroom's 1024 px previews qualify): two Lightroom Classic 15.1 lossy ILCE-7CM2 DNGs went from about 0.8 EV darker and flat to within 3% of Lightroom's mean linear RGB. A DNG's `ProfileGainTableMap` / `ProfileGainTableMap2` (Apple ProRAW's local tone map; both versions, DNG 1.7 precedence, the file's byte order with a big-endian fallback) is read and written back by DNG export and not rendered by default, as Lightroom Classic renders ProRAW without it (measured on one CC0 iPhone 12 Pro ProRAW); the Profile option "Camera local tone mapping" (`profile.camera_local_tone`, per photo, off by default, `crates/pipeline/src/local_tone.rs`) renders it as the camera does, per output pixel in the scene-linear stage (CPU, also under the GPU path); Sony ARW, Nikon NEF, Panasonic RW2, Fujifilm RAF, Canon CR3 and CR2, Pentax PEF, Samsung SRW and Olympus ORF get a guarded file-local fit to their own embedded JPEG — chromaticity matrix + hue/saturation/value table + tone and chroma curves, relative WB — or, with a bundled or local per-model profile pooled from many photos (`lightcraft-cli calibrate`, ARW, NEF and RAF so far, `crates/engine/src/camera_profiles.rs`), the profile's colour and only their own tone/chroma curves (on 29 held-out ILCE-7M4 photos mean ΔE vs the camera JPEG 3.54 → 3.10; bundled ILCE-7CR from 125 photos: 26 held-out 4.07 → 3.29, and every one of the 131 photos accepted, 8 of which fell back to neutral without it; bundled ILCA-99M2 from 144 photos: 30 held-out 5.11 → 4.87, 25 of them closer); the tone fit also uses dark JPEG samples excluded from colour training, so deep shadows follow the camera toe (#1307); near-black frames with too few colour pairs can take a guarded tone-only fallback on their existing source colour (#1587); Sony ARWs shot with DRO on (maker note `0xb025`, on by default) keep that colour but their tone curve is lowered to Sony's curve without DRO, whose lifted shadows are in the camera JPEG only (issue #244: 8 ILCE-7CR photos +6.4 → +0.8 L* from Lightroom's default, median ΔE 7.5 → 3.3); 52 models without a profile whose JPEG fit fails (or that have no usable JPEG) start from DNG-style matrices fitted to their measured spectral sensitivities instead of the neutral fallback (`crates/raw/src/spectral.rs`, rawtoaces-data v1.1.0, Apache-2.0, aliases included; not yet measured against the camera JPEG); ARW: on 10 public raw.pixls.us samples from 8 bodies 7 fits were accepted, mean ΔE vs the camera JPEG 17–26 → 3–10; NEF: 13 of 13 decodable samples (D750, D780, D850, D7500, Z 50 and local D7500 shots) accepted, ΔE 13–46 → 3–8 (issue #150); RW2 / RWL: 140 of 174 public samples accepted, from 93 of the 114 bodies with a preview, median ΔE 5.0 with matching lightness (13 of the 14 corpus files with a preview: ΔE 9.6–27 → 2.8–8.9; most rejections are compacts and kit zooms whose camera JPEG is distortion-corrected); a fit that fails the gates on all pixels is retried away from edges, where a lens-corrected camera JPEG still lines up (issue #232: the six distortion-corrected public ILCE-7RM2 samples ΔE 16.6–16.9 → 3.7–3.8, the corpus GX80 19.1 → 7.9); RAF: bundled X-H2S/X-T4 profiles from 201/545 photos; on 150 withheld files mean ΔE improves slightly over per-file fitting (X-H2S 1.70 → 1.62, X-T4 2.43 → 2.34); 23 of 24 references from 13 bodies accepted, including the dark X-H2S samples (8.74 → 2.25); ORF: the 3 decodable corpus files (E-1, E-400, XZ-2) accepted (`docs/camera-preview-colour.md`); a raw whose camera JPEG is black and white (a monochrome picture style) takes only the JPEG's tone curve, on the camera profile's, spectral or neutral colour (issue #577); this is not measured camera calibration; other raws and rejected fits use a neutral fallback (camera RGB ≈ linear sRGB, `matrix_is_fallback`) with as-shot white balance, so colours are muted and not accurate. Needs our own per-camera calibration: matrices the files carry themselves (e.g. Olympus `ColorMatrix`), fitting each camera to its own embedded JPEG, then chart shots. Adobe matrices / DCPs are never shipped or used (a user can import their own `.dcp`, LR-PROF-IMPORT). Biggest image-quality gap today; ILCE-7RM6: per-file fit now runs on previews above 64 MP, a pooled profile (46 photos) was tried and not bundled (withheld ΔE 5.71 → 6.40, 11 of 15 regressed), kept with smart previews (see docs/camera-preview-colour.md); the fit pairs the sensor moved into the file's lens-warp geometry when that lines up better with a lens-corrected camera JPEG (29 CC0 raws: alignment +0.13, mean ΔE 3.73 → 3.61); bundled NIKON Z 6_2 profile (296 photos; 59 held-back photos mean ΔE 2.73 → 2.54) NIKON Z 8 profile (261 photos; 55 held back 2.55 → 2.33) and NIKON D5300 profile (264 photos; 53 held back 2.86 → 2.66) | -| LR-PROF-CAMERACOLOR | Camera colour calibration (own) | P0 | 🟡 | `crates/raw/src/color.rs`, `crates/raw/src/profile.rs`, `crates/raw/src/gaintable.rs`, `crates/engine/src/camera_preview.rs` | DNG files use the colour matrices and the camera-profile look they carry (`ProfileHueSatMap`, `ProfileLookTable`, `ProfileToneCurve`, read from the file at run time per DNG spec ch. 6 — Lightroom-converted DNGs rendered flat and muted without them, issue #138). A DNG whose profile defines no tone curve (absent or identity `ProfileToneCurve`, with or without a `LookTable`, as Adobe Standard in Lightroom-written DNGs) gets its tone fitted to its embedded preview when that is at least 10% of the raw's long edge and 384 px (Lightroom's 1024 px previews qualify): two Lightroom Classic 15.1 lossy ILCE-7CM2 DNGs went from about 0.8 EV darker and flat to within 3% of Lightroom's mean linear RGB. A DNG's `ProfileGainTableMap` / `ProfileGainTableMap2` (Apple ProRAW's local tone map; both versions, DNG 1.7 precedence, the file's byte order with a big-endian fallback) is read and written back by DNG export and not rendered by default, as Lightroom Classic renders ProRAW without it (measured on one CC0 iPhone 12 Pro ProRAW); the Profile option "Camera local tone mapping" (`profile.camera_local_tone`, per photo, off by default, `crates/pipeline/src/local_tone.rs`) renders it as the camera does, per output pixel in the scene-linear stage (CPU, also under the GPU path); Sony ARW, Nikon NEF, Panasonic RW2, Fujifilm RAF, Canon CR3 and CR2, Pentax PEF, Samsung SRW and Olympus ORF get a guarded file-local fit to their own embedded JPEG — chromaticity matrix + hue/saturation/value table + tone and chroma curves, relative WB — or, with a bundled or local per-model profile pooled from many photos (`lightcraft-cli calibrate`, ARW, NEF and RAF so far, `crates/engine/src/camera_profiles.rs`), the profile's colour and only their own tone/chroma curves (on 29 held-out ILCE-7M4 photos mean ΔE vs the camera JPEG 3.54 → 3.10; bundled ILCE-7CR from 125 photos: 26 held-out 4.07 → 3.29, and every one of the 131 photos accepted, 8 of which fell back to neutral without it; bundled ILCA-99M2 from 144 photos: 30 held-out 5.11 → 4.87, 25 of them closer); the tone fit also uses dark JPEG samples excluded from colour training, so deep shadows follow the camera toe (#1307); near-black frames with too few colour pairs can take a guarded tone-only fallback on their existing source colour (#1587); Sony ARWs shot with DRO on (maker note `0xb025`, on by default) keep that colour but their tone curve is lowered to Sony's curve without DRO, whose lifted shadows are in the camera JPEG only (issue #244: 8 ILCE-7CR photos +6.4 → +0.8 L* from Lightroom's default, median ΔE 7.5 → 3.3); 52 models without a profile whose JPEG fit fails (or that have no usable JPEG) start from DNG-style matrices fitted to their measured spectral sensitivities instead of the neutral fallback (`crates/raw/src/spectral.rs`, rawtoaces-data v1.1.0, Apache-2.0, aliases included; not yet measured against the camera JPEG); the Canon EOS D60 (CRW) has DNG-style matrices of our own, fitted to ColorChecker Classic shots under a tungsten bulb and direct sun (`crates/raw/src/chart_table.rs`, `clean-room/crw/10-chart-calibration.md`; CIEDE2000 on the chart mean 2.4 / 1.7, 2.7 / 2.0 leaving each patch out), which give its white balance a Kelvin scale (the camera's own presets read Tungsten 3,264 K, Daylight 5,603 K, Cloudy 6,612 K) while its look stays the JPEG fit; ARW: on 10 public raw.pixls.us samples from 8 bodies 7 fits were accepted, mean ΔE vs the camera JPEG 17–26 → 3–10; NEF: 13 of 13 decodable samples (D750, D780, D850, D7500, Z 50 and local D7500 shots) accepted, ΔE 13–46 → 3–8 (issue #150); RW2 / RWL: 140 of 174 public samples accepted, from 93 of the 114 bodies with a preview, median ΔE 5.0 with matching lightness (13 of the 14 corpus files with a preview: ΔE 9.6–27 → 2.8–8.9; most rejections are compacts and kit zooms whose camera JPEG is distortion-corrected); a fit that fails the gates on all pixels is retried away from edges, where a lens-corrected camera JPEG still lines up (issue #232: the six distortion-corrected public ILCE-7RM2 samples ΔE 16.6–16.9 → 3.7–3.8, the corpus GX80 19.1 → 7.9); RAF: bundled X-H2S/X-T4 profiles from 201/545 photos; on 150 withheld files mean ΔE improves slightly over per-file fitting (X-H2S 1.70 → 1.62, X-T4 2.43 → 2.34); 23 of 24 references from 13 bodies accepted, including the dark X-H2S samples (8.74 → 2.25); ORF: the 3 decodable corpus files (E-1, E-400, XZ-2) accepted (`docs/camera-preview-colour.md`); a raw whose camera JPEG is black and white (a monochrome picture style) takes only the JPEG's tone curve, on the camera profile's, spectral or neutral colour (issue #577); this is not measured camera calibration; other raws and rejected fits use a neutral fallback (camera RGB ≈ linear sRGB, `matrix_is_fallback`) with as-shot white balance, so colours are muted and not accurate. Needs our own per-camera calibration: matrices the files carry themselves (e.g. Olympus `ColorMatrix`), fitting each camera to its own embedded JPEG, then chart shots. Adobe matrices / DCPs are never used. Biggest image-quality gap today; ILCE-7RM6: per-file fit now runs on previews above 64 MP, a pooled profile (46 photos) was tried and not bundled (withheld ΔE 5.71 → 6.40, 11 of 15 regressed), kept with smart previews (see docs/camera-preview-colour.md); the fit pairs the sensor moved into the file's lens-warp geometry when that lines up better with a lens-corrected camera JPEG (29 CC0 raws: alignment +0.13, mean ΔE 3.73 → 3.61); bundled NIKON Z 6_2 profile (296 photos; 59 held-back photos mean ΔE 2.73 → 2.54) NIKON Z 8 profile (261 photos; 55 held back 2.55 → 2.33) and NIKON D5300 profile (264 photos; 53 held back 2.86 → 2.66) | +| LR-PROF-CAMERACOLOR | Camera colour calibration (own) | P0 | 🟡 | `crates/raw/src/color.rs`, `crates/raw/src/profile.rs`, `crates/raw/src/gaintable.rs`, `crates/engine/src/camera_preview.rs` | DNG files use the colour matrices and the camera-profile look they carry (`ProfileHueSatMap`, `ProfileLookTable`, `ProfileToneCurve`, read from the file at run time per DNG spec ch. 6 — Lightroom-converted DNGs rendered flat and muted without them, issue #138). A DNG whose profile defines no tone curve (absent or identity `ProfileToneCurve`, with or without a `LookTable`, as Adobe Standard in Lightroom-written DNGs) gets its tone fitted to its embedded preview when that is at least 10% of the raw's long edge and 384 px (Lightroom's 1024 px previews qualify): two Lightroom Classic 15.1 lossy ILCE-7CM2 DNGs went from about 0.8 EV darker and flat to within 3% of Lightroom's mean linear RGB. A DNG's `ProfileGainTableMap` / `ProfileGainTableMap2` (Apple ProRAW's local tone map; both versions, DNG 1.7 precedence, the file's byte order with a big-endian fallback) is read and written back by DNG export and not rendered by default, as Lightroom Classic renders ProRAW without it (measured on one CC0 iPhone 12 Pro ProRAW); the Profile option "Camera local tone mapping" (`profile.camera_local_tone`, per photo, off by default, `crates/pipeline/src/local_tone.rs`) renders it as the camera does, per output pixel in the scene-linear stage (CPU, also under the GPU path); Sony ARW, Nikon NEF, Panasonic RW2, Fujifilm RAF, Canon CR3 and CR2, Pentax PEF, Samsung SRW and Olympus ORF get a guarded file-local fit to their own embedded JPEG — chromaticity matrix + hue/saturation/value table + tone and chroma curves, relative WB — or, with a bundled or local per-model profile pooled from many photos (`lightcraft-cli calibrate`, ARW, NEF and RAF so far, `crates/engine/src/camera_profiles.rs`), the profile's colour and only their own tone/chroma curves (on 29 held-out ILCE-7M4 photos mean ΔE vs the camera JPEG 3.54 → 3.10; bundled ILCE-7CR from 125 photos: 26 held-out 4.07 → 3.29, and every one of the 131 photos accepted, 8 of which fell back to neutral without it; bundled ILCA-99M2 from 144 photos: 30 held-out 5.11 → 4.87, 25 of them closer); the tone fit also uses dark JPEG samples excluded from colour training, so deep shadows follow the camera toe (#1307); near-black frames with too few colour pairs can take a guarded tone-only fallback on their existing source colour (#1587); Sony ARWs shot with DRO on (maker note `0xb025`, on by default) keep that colour but their tone curve is lowered to Sony's curve without DRO, whose lifted shadows are in the camera JPEG only (issue #244: 8 ILCE-7CR photos +6.4 → +0.8 L* from Lightroom's default, median ΔE 7.5 → 3.3); 52 models without a profile whose JPEG fit fails (or that have no usable JPEG) start from DNG-style matrices fitted to their measured spectral sensitivities instead of the neutral fallback (`crates/raw/src/spectral.rs`, rawtoaces-data v1.1.0, Apache-2.0, aliases included; not yet measured against the camera JPEG); the Canon EOS D60 (CRW) has DNG-style matrices of our own, fitted to ColorChecker Classic shots under a tungsten bulb and direct sun (`crates/raw/src/chart_table.rs`, `clean-room/crw/10-chart-calibration.md`; CIEDE2000 on the chart mean 2.4 / 1.7, 2.7 / 2.0 leaving each patch out), which give its white balance a Kelvin scale (the camera's own presets read Tungsten 3,264 K, Daylight 5,603 K, Cloudy 6,612 K) while its look stays the JPEG fit; ARW: on 10 public raw.pixls.us samples from 8 bodies 7 fits were accepted, mean ΔE vs the camera JPEG 17–26 → 3–10; NEF: 13 of 13 decodable samples (D750, D780, D850, D7500, Z 50 and local D7500 shots) accepted, ΔE 13–46 → 3–8 (issue #150); RW2 / RWL: 140 of 174 public samples accepted, from 93 of the 114 bodies with a preview, median ΔE 5.0 with matching lightness (13 of the 14 corpus files with a preview: ΔE 9.6–27 → 2.8–8.9; most rejections are compacts and kit zooms whose camera JPEG is distortion-corrected); a fit that fails the gates on all pixels is retried away from edges, where a lens-corrected camera JPEG still lines up (issue #232: the six distortion-corrected public ILCE-7RM2 samples ΔE 16.6–16.9 → 3.7–3.8, the corpus GX80 19.1 → 7.9); RAF: bundled X-H2S/X-T4 profiles from 201/545 photos; on 150 withheld files mean ΔE improves slightly over per-file fitting (X-H2S 1.70 → 1.62, X-T4 2.43 → 2.34); 23 of 24 references from 13 bodies accepted, including the dark X-H2S samples (8.74 → 2.25); ORF: the 3 decodable corpus files (E-1, E-400, XZ-2) accepted (`docs/camera-preview-colour.md`); a raw whose camera JPEG is black and white (a monochrome picture style) takes only the JPEG's tone curve, on the camera profile's, spectral or neutral colour (issue #577); this is not measured camera calibration; other raws and rejected fits use a neutral fallback (camera RGB ≈ linear sRGB, `matrix_is_fallback`) with as-shot white balance, so colours are muted and not accurate. Needs our own per-camera calibration: matrices the files carry themselves (e.g. Olympus `ColorMatrix`), fitting each camera to its own embedded JPEG, then chart shots. Adobe matrices / DCPs are never shipped or used (a user can import their own `.dcp`, LR-PROF-IMPORT). Biggest image-quality gap today; ILCE-7RM6: per-file fit now runs on previews above 64 MP, a pooled profile (46 photos) was tried and not bundled (withheld ΔE 5.71 → 6.40, 11 of 15 regressed), kept with smart previews (see docs/camera-preview-colour.md); the fit pairs the sensor moved into the file's lens-warp geometry when that lines up better with a lens-corrected camera JPEG (29 CC0 raws: alignment +0.13, mean ΔE 3.73 → 3.61); bundled NIKON Z 6_2 profile (296 photos; 59 held-back photos mean ΔE 2.73 → 2.54) NIKON Z 8 profile (261 photos; 55 held back 2.55 → 2.33) and NIKON D5300 profile (264 photos; 53 held back 2.86 → 2.66) | | LR-PROF-CREATIVE | Creative profiles (own) | P2 | ✅ | `cmd:develop.profile`, `crates/pipeline/src/profiles.rs` | 16 own looks in Film / Cinematic / Muted / B&W (tone + point-curve fades, colour grading, mixer / B&W mix); scale with `ctl:profile.amount`; sliders untouched | | LR-PROF-LEGACY | Legacy profiles | P2 | ⬜ | | | | LR-PROF-NONRAW | Profiles for non-raw files | P0 | ✅ | `cmd:develop.profile` | same looks apply to JPEG/TIFF | From 32a9b05bc5b13de6472df72ae720b160e194cbab Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Thu, 5 Nov 2026 06:25:29 +0100 Subject: [PATCH 27/27] Process key tests take the profile salt argument --- crates/engine/src/media/thumbnail_hash_tests.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/media/thumbnail_hash_tests.rs b/crates/engine/src/media/thumbnail_hash_tests.rs index 267f73eb9f5..85089d231d2 100644 --- a/crates/engine/src/media/thumbnail_hash_tests.rs +++ b/crates/engine/src/media/thumbnail_hash_tests.rs @@ -37,8 +37,8 @@ fn persistent_keys_name_the_process_the_settings_render_with() { let resolved = u64::from(lightcraft_develop::Process::LATEST.version().0); let keys = [ (s.thumb_job(PhotoId(1), 256).unwrap().cache.unwrap().1, None, 256), - (crate::Session::view_key(&p, true), Some("view"), 1), - (crate::Session::variant_key(&p, &newer, 256), Some("variant"), 256), + (crate::Session::view_key(&p, true, 0), Some("view"), 1), + (crate::Session::variant_key(&p, &newer, 256, 0), Some("variant"), 256), ]; for (key, kind, size) in keys { assert_ne!(key, unnamed(kind, size), "old builds did not name their resolved process"); @@ -69,8 +69,8 @@ fn v1_and_v2_photos_keep_the_render_cache_keys_they_had() { }; let keys = [ s.thumb_job(PhotoId(1), 256).unwrap().cache.unwrap().1 == before_v3(None, 256), - crate::Session::view_key(&p, true) == before_v3(Some("view"), 1), - crate::Session::variant_key(&p, &settings, 256) == before_v3(Some("variant"), 256), + crate::Session::view_key(&p, true, 0) == before_v3(Some("view"), 1), + crate::Session::variant_key(&p, &settings, 256, 0) == before_v3(Some("variant"), 256), ]; let old = process <= Process::V2; assert_eq!(keys, [old; 3], "{process:?}: thumbnail, view and variant keys");