LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust
Merge PR #1772
Brandon Thomasf815f8895894
diff --cc crates/engine/src/tests_xmp.rsindex da2c38d7d,3649b0b43..1380e95fb--- a/crates/engine/src/tests_xmp.rs+++ b/crates/engine/src/tests_xmp.rs@@@ -1261,29 -1210,41 +1261,68 @@@ fn files_sharing_a_stem_get_their_own_slet _ = std::fs::remove_dir_all(&lib);}+/// Lossy DNG export: demosaiced JPEG tiles at the resize long edge, smaller than lossless, colour tags kept.+#[test]+fn lossy_dng_export_scales_and_shrinks() {+ let src = temp_dir("lossydng");+ std::fs::write(src.join("synth.dng"), synthetic_dng_with(None, Default::default())).unwrap();+ let mut s = Session::new().with_fs();+ s.execute("library.import", &json!({"paths": [src.to_string_lossy()]})).unwrap();+ let id = s.catalog.photos().next().unwrap().id;+ let mut export = |p: serde_json::Value| {+ let o = crate::export::ExportOptions::from_json(&p);+ let mut out = Vec::new();+ let mut write = |_: &str, b: &[u8]| {+ out = b.to_vec();+ Ok(())+ };+ crate::export::export_batch(&mut s, &[id], &o, &crate::export::Destination { dir: "x".into(), exact: None }, &mut write, &|_| false).unwrap();+ out+ };+ let lossless = export(json!({"format": "dng"}));+ let lossy = export(json!({"format": "dng", "dngCompression": "lossy", "quality": 80, "longEdge": 32}));+ let raw = lightcraft_raw::decode(&lossy).unwrap();+ assert_eq!((raw.cpp, raw.cfa.is_none(), raw.width.max(raw.height)), (3, true, 32));+ assert_eq!(raw.color.as_shot_neutral, Some([0.5, 1.0, 0.7]));+ assert!(lossy.len() < lossless.len(), "{} vs {}", lossy.len(), lossless.len());+ let _ = std::fs::remove_dir_all(&src);+}+++ /// An automatic sidecar write that fails (here the folder is read-only, as a network share that dropped out or went+ /// read-only) waits instead of being forgotten, and `library.retrySidecars` writes it once the folder takes writes+ /// again.+ #[cfg(unix)]+ #[test]+ fn a_failed_auto_write_waits_and_is_written_on_retry() {+ use std::os::unix::fs::PermissionsExt;+ let src = temp_dir("auto-retry");+ write_png(&src.join("a.png"), 4);+ let mut s = Session::new().with_fs();+ s.execute("library.import", &json!({"paths": [src.to_string_lossy()]})).unwrap();+ s.execute("library.xmpPreferences", &json!({"autoWrite": true})).unwrap();+ std::fs::set_permissions(&src, std::fs::Permissions::from_mode(0o555)).unwrap();+ // (root writes anyway: nothing to test there)+ if std::fs::write(src.join(".probe"), b"x").is_ok() {+ std::fs::set_permissions(&src, std::fs::Permissions::from_mode(0o755)).unwrap();+ return;+ }+ s.execute("photo.rate", &json!({"rating": 4})).unwrap();+ let sidecar = src.join("a.xmp");+ assert!(!sidecar.exists());+ assert_eq!(s.unsaved_sidecars(), 1, "the failed write waits");+ let r = s.execute("library.retrySidecars", &json!({})).unwrap();+ assert_eq!(r, json!({"written": 0, "waiting": 1}), "still read-only");+ std::fs::set_permissions(&src, std::fs::Permissions::from_mode(0o755)).unwrap();+ let r = s.execute("library.retrySidecars", &json!({})).unwrap();+ assert_eq!(r, json!({"written": 1, "waiting": 0}));+ assert!(std::fs::read_to_string(&sidecar).unwrap().contains("<xmp:Rating>4</xmp:Rating>"));+ // a later edit that writes fine leaves nothing waiting; turning auto-write off drops what still waits+ std::fs::set_permissions(&src, std::fs::Permissions::from_mode(0o555)).unwrap();+ s.execute("photo.rate", &json!({"rating": 3})).unwrap();+ assert_eq!(s.unsaved_sidecars(), 1);+ s.execute("library.xmpPreferences", &json!({"autoWrite": false})).unwrap();+ s.execute("library.retrySidecars", &json!({})).unwrap();+ assert_eq!(s.unsaved_sidecars(), 0);+ std::fs::set_permissions(&src, std::fs::Permissions::from_mode(0o755)).unwrap();+ let _ = std::fs::remove_dir_all(&src);+ }diff --cc docs/parity-checklist.mdindex fe9975e09,716f5e62b..ae58f2500--- a/docs/parity-checklist.md+++ b/docs/parity-checklist.md@@@ -796,10 -790,7 +796,11 @@@ Latin stays upright. Advanced Japanese| Date | Change | Summary ||---|---|---|+| 2026-10-14 | minor | LR-IMP-CAMERA-COVERAGE: 17 uncompressed Olympus and Samsung Adobe models verified on one CC0 file each; status unchanged (π‘) |+| 2026-10-13 | minor | LR-EDIT-SECTION-SOLO: Solo Mode for Edit sections (Window βΈ Edit Sections, section-header menu, β₯-click); KEYC-PANELS notes it |+| 2026-10-14 | minor | LR-MERGE-HDR β β π‘: tested on real 67 MP Sony brackets; moving clipped highlights (black-hole stars) and dark-sky ghosts fixed, merge memory cut ~25 %; AI Denoise on merged DNGs, JPEG response curves and per-frame memory remain (gap 29). LR-MERGE-HEADLESS, MENU-PHOTO-MERGE: HDR for Each Bracket Set (`merge.hdrBatch`) |+| 2026-10-15 | patch | LR-VIEW-BEFOREAFTER: side by side and stacked panes share click-zoom animation for whole-frame images, window tiles and input; render requests keep the final target (#1821); status unchanged |+ | 2026-10-14 | patch | LR-META-XMP: automatic sidecar writes that fail (folder offline or read-only) wait and are written again once the files are reachable, with a notice (`cmd:library.retrySidecars`); status unchanged || 2026-10-13 | patch | LR-VIEW-COMPARE, LRC-LIB-COMPARE: β/Ctrl- and Shift-clicks on the filmstrip in Compare change the selection as in the grid; the two photos shown stay selected and the active photo is unchanged (#187); statuses unchanged || 2026-10-13 | minor | KEYC-SELECTONLYACTIVE: Edit β Select Only Active Photo (ββ§D) lands as a new row; status π‘ (headless-tested, native macOS menu path unverified) || 2026-10-13 | patch | LRC-LIB-CATALOG-IMPORT: a catalog whose tables are all still in its `-wal` file (main file schema format 0) opens instead of failing as an unsupported schema format; status unchanged |diff --cc docs/whats-new.mdindex 9f0b9c10d,6e5268cbe..96f9b19ec--- a/docs/whats-new.md+++ b/docs/whats-new.md@@@ -2,15 -2,12 +2,21 @@@## 2026-10-14+### HDR merges of moving lights, and many brackets at once+- A star, the moon or a light that moves between the photos of a bracket (a night bracket on a tripod) no longer+ leaves a black hole where the middle photo had it clipped. With Deghost, the brightest photo's copy of it in a+ dark sky is now removed too.+- Photo βΈ Photo Merge βΈ HDR for Each Bracket Set merges every bracket among the selected photos with the last HDR+ settings, one after the other: each stack, and photos taken less than a second apart at different exposures.+ From the command line: `lightcraft-cli merge hdr-batch FOLDER`.+- Merging uses about a quarter less memory: three 67 MP raws need 3.8 GB instead of 4.8 GB.++ ### XMP sidecars catch up after a network share comes back+ - With automatic XMP writing on, an edit to a photo whose folder can't be written (a network share that dropped+ out, a folder that went read-only) used to be written only to the library, with a line in the log, so the sidecar+ stayed behind the edit. LightCraft now says once that the sidecars are waiting, tries again every few seconds once+ the files are reachable, and says when they're written. `library.retrySidecars` does it on request.+### Hard-edged Heal and Clone spots- A spot with Feather at 0 no longer draws black pixels exactly on its radius. This also fixes spots at 0% Opacitychanging pixels along their edge. The hard edge now leaves pixels on the radius unchanged.