From cf35cd16944e8ea2608f24598579915ab8ee7355 Mon Sep 17 00:00:00 2001 From: Marco Arnulfo Date: Thu, 29 Oct 2026 23:56:13 +0100 Subject: [PATCH] Lightroom catalog import: check the catalog XMP's radials on a photo already in the library (part of #1806) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test's stored image and LightCraft's size of the photo were both 20 × 10, so fitting radials to the photo's size instead of the stored image went unnoticed. The photo is now already in the library at its shown 10 × 20, as a vertical shot is. --- crates/engine/src/lightroom_catalog/tests.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/lightroom_catalog/tests.rs b/crates/engine/src/lightroom_catalog/tests.rs index a48ed9451..16ea9e4eb 100644 --- a/crates/engine/src/lightroom_catalog/tests.rs +++ b/crates/engine/src/lightroom_catalog/tests.rs @@ -431,7 +431,7 @@ fn imported_crops_use_the_catalog_orientation() { /// Masks only the catalog's XMP has (the develop row has none to replace them) are on the stored /// image too: on a vertical shot (`DA`) they turn like the row's, and a radial keeps its shape on -/// the 2:1 stored image. +/// the 2:1 stored image, also for a photo already in the library at its shown 10 × 20. #[test] fn catalog_xmp_masks_follow_the_photo_orientation() { let mut data = sample(); @@ -454,8 +454,12 @@ fn catalog_xmp_masks_follow_the_photo_orientation() { "# .into(); let mut s = crate::Session::new(); - apply(&mut s, data, false).unwrap(); - let p = s.catalog.photos().next().unwrap(); + let id = s.catalog.alloc_photo_id(); + let shown = Photo::new(id, Source::File { path: "/missing/test.ARW".into() }, "test.ARW", "ARW", 10, 20, "before"); + s.commit("Browse folder", Op::AddPhoto { photo: Box::new(shown) }).unwrap(); + apply(&mut s, data, true).unwrap(); + assert_eq!(s.catalog.len(), 1, "the catalog's photo is the one already in the library"); + let p = s.catalog.photo(id).unwrap(); assert_eq!(p.develop.light.exposure, 0.5, "the develop row is applied too"); let c = &serde_json::to_value(&p.develop.masks).unwrap()[0]["components"]; let (linear, radial) = (&c[0]["shape"], &c[1]["shape"]);