Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

Merge PR #2912: Reject incomplete ISO timestamps in metadata and track logs

aiongge967200f0d61
diff --cc crates/meta/src/xmp/tests.rs
index b6f41d607,000000000..24de3d01a
mode 100644,000000..100644
--- a/crates/meta/src/xmp/tests.rs
+++ b/crates/meta/src/xmp/tests.rs
@@@ -1,493 -1,0 +1,512 @@@
+use super::*;
+
+fn full() -> Metadata {
+ Metadata {
+ // write_xmp doesn't emit regions yet (read-only interchange; see docs/xmp-interop.md), so the
+ // roundtrip fixture must leave this empty or `roundtrip_all_fields` can't round-trip it.
+ regions: Vec::new(),
+ focus: None,
+ make: Some("Maker & Sons".into()),
+ model: Some("X <1>".into()),
+ serial_number: Some("SN1".into()),
+ software: Some("LightCraft".into()),
+ lens_make: Some("L".into()),
+ lens_model: Some("24-70mm".into()),
+ lens_serial_number: Some("LS".into()),
+ lens_spec: Some([24.0, 70.0, 2.8, 2.8]),
+ capture_time: DateTime::parse_iso("2022-05-06T07:08:09.123-04:00"),
+ exposure_time: Some(1.0 / 125.0),
+ f_number: Some(5.6),
+ iso: Some(800),
+ focal_length: Some(35.0),
+ focal_length_35mm: Some(52.0),
+ flash: Some(Flash { fired: true, raw: 0x59 }),
+ exposure_bias: Some(-1.0 / 3.0),
+ exposure_program: Some(2),
+ metering_mode: Some(3),
+ white_balance: Some(1),
+ orientation: Some(Orientation::Rotate270),
+ gps: Some(Gps { latitude: 48.858222, longitude: -2.2945, altitude: Some(-3.5) }),
+ width: Some(8000),
+ height: Some(6000),
+ artist: Some("Ann \"Photo\" Lee".into()),
+ copyright: Some("© 2022".into()),
+ copyright_marked: Some(true),
+ usage_terms: Some("Editorial use only; no <resale>".into()),
+ copyright_url: Some("https://example.com/licence?a=1&b=2".into()),
+ title: Some("Tïtle".into()),
+ caption: Some("Line one\nline two".into()),
+ alt_text: Some("A tree by the sea".into()),
+ extended_description: Some("Long <description>".into()),
+ sublocation: Some("Champ de Mars".into()),
+ city: Some("Paris".into()),
+ state: Some("Île-de-France".into()),
+ country: Some("France".into()),
+ keywords: vec!["tree".into(), "sky & sea".into()],
+ hierarchical_keywords: vec!["Places|France|Paris".into()],
+ rating: Some(-1),
+ label: Some("Green".into()),
+ }
+}
+
+#[test]
+fn roundtrip_all_fields() {
+ let m = full();
+ let json = r#"{"version":1,"exposure":0.5,"note":"<&>"}"#;
+ let x = write_xmp(&m, Some(json));
+ let d = parse_xmp(&x).unwrap();
+ assert_eq!(d.lc_settings.as_deref(), Some(json));
+ let mut got = d.metadata.clone();
+ // floats go through rationals
+ assert!((got.exposure_bias.unwrap() + 1.0 / 3.0).abs() < 1e-5);
+ got.exposure_bias = m.exposure_bias;
+ let g = got.gps.unwrap();
+ assert!((g.latitude - 48.858222).abs() < 1e-6 && (g.longitude + 2.2945).abs() < 1e-6, "{g:?}");
+ got.gps = m.gps;
+ assert_eq!(got, m);
+}
+
+#[test]
+fn empty_metadata_roundtrip() {
+ let x = write_xmp(&Metadata::default(), None);
+ let d = parse_xmp(&x).unwrap();
+ assert_eq!(d.metadata, Metadata::default());
+ assert_eq!(d.lc_settings, None);
+}
+
+#[test]
+fn foreign_namespace_cannot_impersonate_known_metadata() {
+ for body in [
+ r#"xmp:Rating="2" lc:settings="foreign settings"/>"#,
+ r#"><xmp:Rating>2</xmp:Rating><lc:settings>foreign settings</lc:settings></rdf:Description>"#,
+ ] {
+ let packet = format!(
+ r#"<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description
+ xmlns:xmp="https://example.org/vendor/" xmlns:lc="https://example.org/vendor/" {body}</rdf:RDF>"#
+ );
+ let d = parse_xmp(&packet).unwrap();
+ assert_eq!(d.metadata.rating, None, "foreign rating: {packet}");
+ assert_eq!(d.lc_settings, None, "foreign settings: {packet}");
+ assert!(!d.properties.contains_key("xmp:Rating"));
+ assert!(!d.values.contains_key("lc:settings"));
+ assert!(d.properties.values().any(|v| v == &["foreign settings"]));
+ assert!(d.properties.keys().all(|key| !key.contains('/')), "opaque names must not create struct paths");
+ }
+}
+
+#[test]
+fn foreign_namespace_names_are_distinct_and_scoped() {
+ let packet = r#"<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/">
+ <xmp:Rating xmlns:xmp="https://example.org/one/">1</xmp:Rating>
+ <xmp:Rating xmlns:xmp="https://example.org/two/">2</xmp:Rating>
+ <xmp:Rating>4</xmp:Rating>
+ </rdf:Description></rdf:RDF>"#;
+ let d = parse_xmp(packet).unwrap();
+ assert_eq!(d.metadata.rating, Some(4), "a local rebinding must not escape its scope");
+ assert_eq!(d.properties.len(), 3, "different foreign URIs must not collide");
+ assert_eq!(d.values.len(), 3);
+ assert_eq!(d.properties["xmp:Rating"], vec!["4"]);
+ assert!(d.properties.values().any(|v| v == &["1"]));
+ assert!(d.properties.values().any(|v| v == &["2"]));
+}
+
+#[test]
+fn attribute_form_foreign_prefixes_and_structs() {
+ let x = r#"<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about="" xmlns:a="http://ns.adobe.com/xap/1.0/" xmlns:d="http://purl.org/dc/elements/1.1/"
+ xmlns:e="http://ns.adobe.com/exif/1.0/" a:Rating="4" a:Label="Blue" e:FNumber="40/10" e:GPSLatitude="10,30N" e:GPSLongitude="20,15,36W">
+ <d:title><rdf:Alt><rdf:li xml:lang="de">Titel</rdf:li><rdf:li xml:lang="x-default">Title &amp; more &#233;</rdf:li></rdf:Alt></d:title>
+ <e:Flash><rdf:Description e:Fired="False" e:Mode="2"/></e:Flash>
+ <d:subject><rdf:Bag><rdf:li>k1</rdf:li><rdf:li>k2</rdf:li></rdf:Bag></d:subject>
+ </rdf:Description></rdf:RDF></x:xmpmeta>"#;
+ let d = parse_xmp(x).unwrap();
+ let m = d.metadata;
+ assert_eq!(m.rating, Some(4));
+ assert_eq!(m.label.as_deref(), Some("Blue"));
+ assert_eq!(m.f_number, Some(4.0));
+ assert_eq!(m.title.as_deref(), Some("Title & more é"));
+ assert_eq!(m.keywords, vec!["k1".to_string(), "k2".to_string()]);
+ assert_eq!(m.flash, Some(Flash { fired: false, raw: 0x10 }));
+ let g = m.gps.unwrap();
+ assert!((g.latitude - 10.5).abs() < 1e-9);
+ assert!((g.longitude + 20.26).abs() < 1e-9);
+ assert_eq!(d.properties["dc:title"], vec!["Title & more é".to_string(), "Titel".to_string()]);
+}
+
+/// Copyright status, usage terms and info URL (XMP Rights Management schema): written as
+/// `xmpRights:Marked` (Boolean), `xmpRights:UsageTerms` (Lang Alt) and `xmpRights:WebStatement` (URI).
+#[test]
+fn rights_management_fields() {
+ let m = Metadata { copyright_marked: Some(false), usage_terms: Some("CC0".into()), ..Default::default() };
+ let x = write_xmp(&m, None);
+ assert!(x.contains("<xmpRights:Marked>False</xmpRights:Marked>"), "{x}");
+ assert!(x.contains("<xmpRights:UsageTerms>\n <rdf:Alt>\n <rdf:li xml:lang=\"x-default\">CC0</rdf:li>"), "{x}");
+ assert!(!x.contains("WebStatement"), "unset fields are left out");
+ assert_eq!(parse_xmp(&x).unwrap().metadata, m);
+ // attribute form, other prefixes; anything but True / False is "unknown"
+ let read = |marked: &str| {
+ let x = format!(
+ r#"<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about="" xmlns:r="http://ns.adobe.com/xap/1.0/rights/" r:Marked="{marked}" r:WebStatement="https://example.org/c"/>
+ </rdf:RDF></x:xmpmeta>"#
+ );
+ parse_xmp(&x).unwrap().metadata
+ };
+ assert_eq!(read("True").copyright_marked, Some(true));
+ assert_eq!(read("false").copyright_marked, Some(false));
+ assert_eq!(read("").copyright_marked, None);
+ assert_eq!(read("maybe").copyright_marked, None);
+ assert_eq!(read("True").copyright_url.as_deref(), Some("https://example.org/c"));
+}
+
+/// A zero or negative `exif:ISOSpeedRatings` is "no ISO" (as in the EXIF reader), not `Some(0)`, and
+/// must not hide a valid `exifEX:PhotographicSensitivity`.
+#[test]
+fn non_positive_iso_is_ignored() {
+ let read = |attrs: &str| {
+ let x = format!(
+ r#"<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about="" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:exifEX="http://cipa.jp/exif/1.0/" {attrs}/>
+ </rdf:RDF></x:xmpmeta>"#
+ );
+ parse_xmp(&x).unwrap().metadata.iso
+ };
+ assert_eq!(read(r#"exif:ISOSpeedRatings="0" exifEX:PhotographicSensitivity="400""#), Some(400));
+ assert_eq!(read(r#"exif:ISOSpeedRatings="-100""#), None);
+ assert_eq!(read(r#"exif:ISOSpeedRatings="0""#), None);
+ assert_eq!(read(r#"exif:ISOSpeedRatings="200""#), Some(200));
+}
+
+#[test]
+fn malformed_inputs() {
+ assert!(parse_xmp("<a><b></a>").is_ok() || parse_xmp("<a><b></a>").is_err());
+ assert_eq!(parse_xmp("").unwrap().metadata, Metadata::default());
+ assert_eq!(parse_xmp("not xml at all").unwrap().metadata, Metadata::default());
+ let deep = "<a>".repeat(1000);
+ assert_eq!(parse_xmp(&deep), Err(XmpError::TooComplex));
+ let x = write_xmp(&full(), Some("{}"));
+ for n in (0..x.len()).step_by(7) {
+ if x.is_char_boundary(n) {
+ let _ = parse_xmp(&x[..n]);
+ }
+ }
+}
+
+#[test]
+fn lc_extras_and_crs_prefix() {
+ let x = write_xmp_lc(&Metadata::default(), &[("settings", "{\"a\":1}"), ("flag", "pick"), ("bad name", "x")]);
+ assert!(!x.contains("xmlns:crs"), "we never write crs:");
+ let d = parse_xmp(&x).unwrap();
+ assert_eq!(d.lc_settings.as_deref(), Some("{\"a\":1}"));
+ assert_eq!(d.properties["lc:flag"], vec!["pick".to_string()]);
+ assert!(!x.contains("bad name"));
+ let foreign = r#"<rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:cr="http://ns.adobe.com/camera-raw-settings/1.0/" cr:Exposure2012="+0.5"/>"#;
+ assert_eq!(parse_xmp(foreign).unwrap().properties["crs:Exposure2012"], vec!["+0.5".to_string()]);
+}
+
+#[test]
+fn gps_coords() {
+ assert_eq!(parse_gps_coord("45,30N"), Some(45.5));
+ assert_eq!(parse_gps_coord("45,30,36S"), Some(-45.51));
+ assert_eq!(parse_gps_coord("45X"), None);
+ assert_eq!(parse_gps_coord(""), None);
+ assert_eq!(parse_gps_coord("é"), None);
+ assert_eq!(fmt_gps_coord(-45.51, 'N', 'S'), "45,30.600000S");
+ assert_eq!(fmt_gps_coord(10.9999999999, 'N', 'S'), "11,0.000000N");
+ assert_eq!(fmt_gps_coord(-0.9999999999, 'E', 'W'), "1,0.000000W");
+}
+
+/// Like the EXIF and GPX readers, XMP drops a position outside latitude ±90° / longitude ±180°.
+#[test]
+fn xmp_gps_out_of_range_rejected() {
+ let gps = |lat: &str, lon: &str| {
+ let x = format!(
+ r#"<rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:e="http://ns.adobe.com/exif/1.0/" e:GPSLatitude="{lat}" e:GPSLongitude="{lon}"/>"#
+ );
+ parse_xmp(&x).unwrap().metadata.gps
+ };
+ assert_eq!(gps("95,0N", "200,30E"), None);
+ assert_eq!(gps("95,0N", "10,0E"), None);
+ assert_eq!(gps("10,0S", "200,30W"), None);
+ assert_eq!(gps("90,0,1N", "0,0E"), None);
+ assert_eq!(gps("90,0N", "180,0E"), Some(Gps { latitude: 90.0, longitude: 180.0, altitude: None }));
+ assert_eq!(gps("90,0S", "180,0W"), Some(Gps { latitude: -90.0, longitude: -180.0, altitude: None }));
+}
+
+/// MWG Region Guidelines v2.0, element form (`rdf:parseType="Resource"`, self-closing `Area`) — how
+/// Lightroom typically writes it. One named face, one untyped/unnamed region (still usable), one
+/// region with a description. `AppliedToDimensions` is present but irrelevant: normalized areas
+/// (the default, and the only unit real files use) don't need it.
+#[test]
+fn mwg_regions_element_form() {
+ let x = r#"<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about=""
+ xmlns:mwg-rs="http://www.metadataworkinggroup.com/schemas/regions/"
+ xmlns:stArea="http://ns.adobe.com/xmp/sType/Area#"
+ xmlns:stDim="http://ns.adobe.com/xap/1.0/sType/Dimensions#">
+ <mwg-rs:Regions rdf:parseType="Resource">
+ <mwg-rs:AppliedToDimensions rdf:parseType="Resource" stDim:w="4000" stDim:h="3000" stDim:unit="pixel"/>
+ <mwg-rs:RegionList>
+ <rdf:Bag>
+ <rdf:li rdf:parseType="Resource">
+ <mwg-rs:Area rdf:parseType="Resource" stArea:x="0.5" stArea:y="0.4" stArea:w="0.2" stArea:h="0.3" stArea:unit="normalized"/>
+ <mwg-rs:Name>Jane Doe</mwg-rs:Name>
+ <mwg-rs:Type>Face</mwg-rs:Type>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <mwg-rs:Area rdf:parseType="Resource" stArea:x="0.1" stArea:y="0.1" stArea:w="0.05" stArea:h="0.05" stArea:unit="normalized"/>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <mwg-rs:Area rdf:parseType="Resource" stArea:x="0.8" stArea:y="0.2" stArea:w="0.1" stArea:h="0.1" stArea:unit="normalized"/>
+ <mwg-rs:Type>Pet</mwg-rs:Type>
+ <mwg-rs:Name>Rex</mwg-rs:Name>
+ <mwg-rs:Description>Good boy</mwg-rs:Description>
+ </rdf:li>
+ </rdf:Bag>
+ </mwg-rs:RegionList>
+ </mwg-rs:Regions>
+ </rdf:Description></rdf:RDF></x:xmpmeta>"#;
+ let regions = parse_xmp(x).unwrap().metadata.regions;
+ assert_eq!(regions.len(), 3, "{regions:?}");
+
+ assert_eq!(regions[0].kind, RegionKind::Face);
+ assert_eq!(regions[0].name.as_deref(), Some("Jane Doe"));
+ assert_eq!(regions[0].description, None);
+ let r = regions[0].rect;
+ assert!((r.x0 - 0.4).abs() < 1e-9 && (r.x1 - 0.6).abs() < 1e-9, "{r:?}");
+ assert!((r.y0 - 0.25).abs() < 1e-9 && (r.y1 - 0.55).abs() < 1e-9, "{r:?}");
+
+ // No mwg-rs:Type or mwg-rs:Name at all: still a usable region, kind falls back to `Other("")`.
+ assert_eq!(regions[1].kind, RegionKind::Other(String::new()));
+ assert_eq!(regions[1].name, None);
+
+ assert_eq!(regions[2].kind, RegionKind::Pet);
+ assert_eq!(regions[2].name.as_deref(), Some("Rex"));
+ assert_eq!(regions[2].description.as_deref(), Some("Good boy"));
+}
+
+/// Lightroom Classic writes a rotated photo's (Exif orientation 3 / 6 / 8) box in the sensor's frame
+/// and records the orientation as `mwg-rs:Rotation` (±π / −π/2 / +π/2); the reader returns the
+/// upright frame.
+#[test]
+fn mwg_regions_quarter_turn_rotation_is_mapped_to_the_upright_frame() {
+ let x = r#"<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about=""
+ xmlns:mwg-rs="http://www.metadataworkinggroup.com/schemas/regions/"
+ xmlns:stArea="http://ns.adobe.com/xmp/sType/Area#">
+ <mwg-rs:Regions rdf:parseType="Resource">
+ <mwg-rs:RegionList>
+ <rdf:Bag>
+ <rdf:li rdf:parseType="Resource" mwg-rs:Rotation="-1.57080" mwg-rs:Type="Face">
+ <mwg-rs:Area rdf:parseType="Resource" stArea:x="0.3" stArea:y="0.4" stArea:w="0.2" stArea:h="0.3"/>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource" mwg-rs:Rotation="1.57080" mwg-rs:Type="Face">
+ <mwg-rs:Area rdf:parseType="Resource" stArea:x="0.3" stArea:y="0.4" stArea:w="0.2" stArea:h="0.3"/>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource" mwg-rs:Rotation="0.00000" mwg-rs:Type="Face">
+ <mwg-rs:Area rdf:parseType="Resource" stArea:x="0.3" stArea:y="0.4" stArea:w="0.2" stArea:h="0.3"/>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource" mwg-rs:Rotation="3.14159" mwg-rs:Type="Face">
+ <mwg-rs:Area rdf:parseType="Resource" stArea:x="0.3" stArea:y="0.4" stArea:w="0.2" stArea:h="0.3"/>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource" mwg-rs:Rotation="-3.14159" mwg-rs:Type="Face">
+ <mwg-rs:Area rdf:parseType="Resource" stArea:x="0.3" stArea:y="0.4" stArea:w="0.2" stArea:h="0.3"/>
+ </rdf:li>
+ </rdf:Bag>
+ </mwg-rs:RegionList>
+ </mwg-rs:Regions>
+ </rdf:Description></rdf:RDF></x:xmpmeta>"#;
+ let regions = parse_xmp(x).unwrap().metadata.regions;
+ assert_eq!(regions.len(), 5, "{regions:?}");
+ let near = |r: Rect, b: [f64; 4]| [r.x0 - b[0], r.y0 - b[1], r.x1 - b[2], r.y1 - b[3]].iter().all(|d| d.abs() < 1e-9);
+ assert!(near(regions[0].rect, [0.45, 0.2, 0.75, 0.4]), "−π/2 (orientation 6): {:?}", regions[0].rect);
+ assert!(near(regions[1].rect, [0.25, 0.6, 0.55, 0.8]), "+π/2 (orientation 8): {:?}", regions[1].rect);
+ assert!(near(regions[2].rect, [0.2, 0.25, 0.4, 0.55]), "0 is untouched: {:?}", regions[2].rect);
+ assert!(near(regions[3].rect, [0.6, 0.45, 0.8, 0.75]), "π (orientation 3): {:?}", regions[3].rect);
+ assert!(near(regions[4].rect, [0.6, 0.45, 0.8, 0.75]), "−π (orientation 3): {:?}", regions[4].rect);
+}
+
+/// A second, differently-shaped encoding: each region is its own `rdf:Description` (rather than an
+/// `rdf:li rdf:parseType="Resource"`), `mwg-rs:Type` as an attribute instead of an element, and an
+/// unrecognised `mwg-rs:Type` value kept verbatim.
+#[test]
+fn mwg_regions_attribute_form_and_unknown_type() {
+ let x = r#"<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about=""
+ xmlns:mwg-rs="http://www.metadataworkinggroup.com/schemas/regions/"
+ xmlns:stArea="http://ns.adobe.com/xmp/sType/Area#">
+ <mwg-rs:Regions rdf:parseType="Resource">
+ <mwg-rs:RegionList>
+ <rdf:Bag>
+ <rdf:li>
+ <rdf:Description mwg-rs:Type="BarCode">
+ <mwg-rs:Area stArea:x="0.3" stArea:y="0.3" stArea:w="0.1" stArea:h="0.1"/>
+ </rdf:Description>
+ </rdf:li>
+ <rdf:li>
+ <rdf:Description mwg-rs:Type="Sticker">
+ <mwg-rs:Area stArea:x="0.6" stArea:y="0.6" stArea:w="0.1" stArea:h="0.1"/>
+ </rdf:Description>
+ </rdf:li>
+ </rdf:Bag>
+ </mwg-rs:RegionList>
+ </mwg-rs:Regions>
+ </rdf:Description></rdf:RDF>"#;
+ let regions = parse_xmp(x).unwrap().metadata.regions;
+ assert_eq!(regions.len(), 2, "{regions:?}");
+ assert_eq!(regions[0].kind, RegionKind::BarCode);
+ assert_eq!(regions[1].kind, RegionKind::Other("Sticker".to_string()));
+}
+
+/// Hostile/malformed regions are dropped individually, never panic, and never poison the rest of
+/// the list: missing Area, non-finite or absurd numbers, zero/negative size, and a pixel-unit area
+/// with no `AppliedToDimensions` to convert it (so it can't be stored as a nonsense fraction).
+#[test]
+fn mwg_regions_hostile_inputs_are_dropped_not_panicking() {
+ let x = r#"<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about=""
+ xmlns:mwg-rs="http://www.metadataworkinggroup.com/schemas/regions/"
+ xmlns:stArea="http://ns.adobe.com/xmp/sType/Area#">
+ <mwg-rs:Regions rdf:parseType="Resource">
+ <mwg-rs:RegionList>
+ <rdf:Bag>
+ <rdf:li rdf:parseType="Resource"><mwg-rs:Name>No Area</mwg-rs:Name></rdf:li>
+ <rdf:li rdf:parseType="Resource"><mwg-rs:Area rdf:parseType="Resource" stArea:x="NaN" stArea:y="0.1" stArea:w="0.1" stArea:h="0.1"/></rdf:li>
+ <rdf:li rdf:parseType="Resource"><mwg-rs:Area rdf:parseType="Resource" stArea:x="1e300" stArea:y="0.1" stArea:w="0.1" stArea:h="0.1"/></rdf:li>
+ <rdf:li rdf:parseType="Resource"><mwg-rs:Area rdf:parseType="Resource" stArea:x="0.5" stArea:y="0.5" stArea:w="0" stArea:h="0.1"/></rdf:li>
+ <rdf:li rdf:parseType="Resource"><mwg-rs:Area rdf:parseType="Resource" stArea:x="0.5" stArea:y="0.5" stArea:w="-0.1" stArea:h="0.1"/></rdf:li>
+ <rdf:li rdf:parseType="Resource"><mwg-rs:Area rdf:parseType="Resource" stArea:x="100" stArea:y="100" stArea:w="50" stArea:h="50" stArea:unit="pixel"/></rdf:li>
+ <rdf:li rdf:parseType="Resource"><mwg-rs:Area rdf:parseType="Resource" stArea:x="0.5" stArea:y="0.5" stArea:w="0.2" stArea:h="0.2"/><mwg-rs:Type>Face</mwg-rs:Type></rdf:li>
+ </rdf:Bag>
+ </mwg-rs:RegionList>
+ </mwg-rs:Regions>
+ </rdf:Description></rdf:RDF>"#;
+ let regions = parse_xmp(x).unwrap().metadata.regions;
+ assert_eq!(regions.len(), 1, "only the last, well-formed region should survive: {regions:?}");
+ assert_eq!(regions[0].kind, RegionKind::Face);
+}
+
+/// Regions are clipped to the photo frame, and ones that miss the photo entirely are dropped: a
+/// hostile sidecar can't park a box at x=1e5 (or a 1e5-wide one) that the loupe or the People view
+/// would then draw or crop far outside the image.
+#[test]
+fn mwg_regions_are_clipped_to_the_frame_and_off_photo_ones_dropped() {
+ let x = r#"<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about=""
+ xmlns:mwg-rs="http://www.metadataworkinggroup.com/schemas/regions/"
+ xmlns:stArea="http://ns.adobe.com/xmp/sType/Area#">
+ <mwg-rs:Regions rdf:parseType="Resource">
+ <mwg-rs:RegionList>
+ <rdf:Bag>
+ <rdf:li rdf:parseType="Resource"><mwg-rs:Area rdf:parseType="Resource" stArea:x="1e5" stArea:y="0.5" stArea:w="0.1" stArea:h="0.1"/><mwg-rs:Name>Far right</mwg-rs:Name></rdf:li>
+ <rdf:li rdf:parseType="Resource"><mwg-rs:Area rdf:parseType="Resource" stArea:x="-3" stArea:y="-3" stArea:w="0.5" stArea:h="0.5"/><mwg-rs:Name>Far left</mwg-rs:Name></rdf:li>
+ <rdf:li rdf:parseType="Resource"><mwg-rs:Area rdf:parseType="Resource" stArea:x="1.2" stArea:y="0.5" stArea:w="0.2" stArea:h="0.2"/><mwg-rs:Name>Touching edge</mwg-rs:Name></rdf:li>
+ <rdf:li rdf:parseType="Resource"><mwg-rs:Area rdf:parseType="Resource" stArea:x="0.5" stArea:y="0.5" stArea:w="1e5" stArea:h="1e5"/><mwg-rs:Name>Huge</mwg-rs:Name></rdf:li>
+ <rdf:li rdf:parseType="Resource"><mwg-rs:Area rdf:parseType="Resource" stArea:x="0.95" stArea:y="0.05" stArea:w="0.2" stArea:h="0.2"/><mwg-rs:Name>Corner</mwg-rs:Name></rdf:li>
+ </rdf:Bag>
+ </mwg-rs:RegionList>
+ </mwg-rs:Regions>
+ </rdf:Description></rdf:RDF>"#;
+ let regions = parse_xmp(x).unwrap().metadata.regions;
+ let names: Vec<_> = regions.iter().map(|r| r.name.as_deref().unwrap_or("")).collect();
+ assert_eq!(names, ["Huge", "Corner"], "{regions:?}");
+ for r in &regions {
+ let q = r.rect;
+ assert!(q.x0 >= 0.0 && q.y0 >= 0.0 && q.x1 <= 1.0 && q.y1 <= 1.0 && !q.is_empty(), "{q:?}");
+ }
+ assert_eq!(regions[0].rect, Rect::UNIT);
+ let c = regions[1].rect;
+ assert!((c.x0 - 0.85).abs() < 1e-9 && c.x1 == 1.0 && c.y0 == 0.0 && (c.y1 - 0.15).abs() < 1e-9, "{c:?}");
+}
+
+/// `extract()`'s precedence (EXIF/IPTC never carry regions; XMP is read and filled in like keywords).
+#[test]
+fn regions_merge_like_keywords() {
+ let with_region = Region { rect: Rect::from_center(Point::new(0.5, 0.5), 0.2, 0.2), kind: RegionKind::Face, name: None, description: None };
+ let mut a = Metadata::default();
+ let b = Metadata { regions: vec![with_region.clone()], ..Default::default() };
+ a.fill_missing(&b);
+ assert_eq!(a.regions, vec![with_region.clone()]);
+
+ let mut a = Metadata::default();
+ a.overlay_user_fields(&b);
+ assert_eq!(a.regions, vec![with_region]);
+}
+
+#[test]
+fn writer_drops_characters_xml_1_0_forbids() {
+ let bad = "a\u{1}b\u{0}c\u{FFFE}d\u{FFFF}e\u{1F}\tf\ng\rh";
+ let m = Metadata { make: Some(bad.into()), caption: Some(bad.into()), keywords: vec![bad.into()], ..Default::default() };
+ let x = write_xmp_lc(&m, &[("settings", bad)]);
+ let illegal: Vec<char> =
+ x.chars().filter(|&c| (c < '\u{20}' && !matches!(c, '\t' | '\n' | '\r')) || c == '\u{FFFE}' || c == '\u{FFFF}').collect();
+ assert!(illegal.is_empty(), "illegal XML chars in output: {illegal:?}");
+ assert!(x.contains(">abcde\tf\ng\rh<"), "allowed characters must survive: {x}");
+}
+
+#[test]
+fn numeric_references_to_forbidden_characters_are_not_decoded() {
+ assert_eq!(entity("#1"), None);
+ assert_eq!(entity("#0"), None);
+ assert_eq!(entity("#xFFFE"), None);
+ assert_eq!(entity("#x41"), Some('A'));
+ assert_eq!(entity("#9"), Some('\t'));
+}
+
+/// Flattened keys repeat their whole ancestor path, so a long nested name with a wide child
+/// fan-out would otherwise retain its prefix once per leaf: the cumulative key budget stops it
+/// (a 65 KB document with 3000 leaves must not retain ~2.4 MB of key text).
+#[test]
+fn flattened_keys_stay_within_the_cumulative_budget() {
+ let level = "n".repeat(200);
+ let mut doc = String::from(
+ "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:lc=\"https://lightcraft.example/lc/\"><rdf:RDF><rdf:Description><lc:root rdf:parseType=\"Resource\">",
+ );
+ for _ in 0..4 {
+ doc.push_str(&format!("<lc:{level} rdf:parseType=\"Resource\">"));
+ }
+ // each leaf has a name of its own, so each one adds a key
+ for i in 0..3000 {
+ doc.push_str(&format!("<lc:leaf{i} lc:att=\"v\"/>"));
+ }
+ doc.push_str("</lc:root>");
+ for _ in 0..4 {
+ doc.push_str(&format!("</lc:{level}>"));
+ }
+ doc.push_str("</rdf:Description></rdf:RDF></x:xmpmeta>");
+ let d = parse_xmp(&doc).unwrap();
+ let total: usize = d.properties.keys().map(String::len).sum();
+ assert!(total <= MAX_KEY_BYTES, "flattened-key text {total} is over the {MAX_KEY_BYTES} budget");
+ assert!(d.properties.len() < 3000, "keys stop being added once the budget is spent");
+ assert!(!d.properties.is_empty(), "properties parsed before the budget are kept");
+}
+
+#[test]
+fn entity_rejects_signed_numeric_references() {
+ assert_eq!(entity("#+65"), None);
+ assert_eq!(entity("#x+41"), None);
+ assert_eq!(entity("#65"), Some('A'));
+ assert_eq!(entity("#x41"), Some('A'));
+}
++
++#[test]
++fn malformed_capture_time_falls_back_and_keeps_raw_property() {
++ let packet = r#"<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" exif:DateTimeOriginal="2026-01-01T" xmp:CreateDate="2026-01-02T10:00:00Z"/></rdf:RDF></x:xmpmeta>"#;
++ let parsed = parse_xmp(packet).unwrap();
++ assert_eq!(
++ parsed.metadata.capture_time.map(|d| (d.year, d.month, d.day, d.hour, d.minute, d.second, d.offset_minutes)),
++ Some((2026, 1, 2, 10, 0, 0, Some(0)))
++ );
++ assert_eq!(parsed.properties["exif:DateTimeOriginal"], vec!["2026-01-01T".to_string()]);
++}
++
++#[test]
++fn malformed_capture_time_without_fallback_is_not_projected() {
++ let packet = r#"<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:exif="http://ns.adobe.com/exif/1.0/" exif:DateTimeOriginal="2026-01-01T"/></rdf:RDF></x:xmpmeta>"#;
++ let parsed = parse_xmp(packet).unwrap();
++ assert_eq!(parsed.metadata.capture_time, None);
++ assert_eq!(parsed.properties["exif:DateTimeOriginal"], vec!["2026-01-01T".to_string()]);
++}
diff --cc docs/gaps.md
index c6877f5b3,ac5073cc1..e547fa615
--- a/docs/gaps.md
+++ b/docs/gaps.md
@@@ -1,6 -1,6 +1,6 @@@
# Gaps: where LightCraft falls short of Lightroom
- > **Last reviewed:** 2026-10-11 · **Last updated:** 2026-10-24 · **Change:** minor (gap 8: lens profile work is tracked in #329; gap 30: the Info panel shows the selected photos' shared metadata and marks mixed fields; gap 28: ⌘⌥⇧C / ⌘⌥⇧V copy and paste metadata; gap 13: before a Lightroom catalog import the app asks merge or new library, #2672; gap 28: F8 shows / hides the right panel; import review album hierarchy, #2362; gap 20: Minolta MRW decodes; gap 10: 551 models verified; gap 15: Print Page Options — page numbers, page info, crop marks; gap 28: `\` shows / hides the Filter Bar in the grids; gap 21: Indonesian interface shipped, every message but What's New; gap 27: the Windows x64 installer verified on Windows 11; the Settings → Apps uninstall confirmation remains; gap 28: ⌘L Enable Filters switches the filter off and on; gap 15: Japanese photo and postcard paper sizes in the Print page setup and PDF)
-> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-10-25 · **Change:** minor (gap 30: the Info panel shows the selected photos' shared metadata and marks mixed fields; gap 28: ⌘⌥⇧C / ⌘⌥⇧V copy and paste metadata; gap 13: before a Lightroom catalog import the app asks merge or new library, #2672; gap 28: F8 shows / hides the right panel; import review album hierarchy, #2362; gap 20: Minolta MRW decodes; gap 10: 551 models verified; gap 15: Print Page Options — page numbers, page info, crop marks; gap 28: `\` shows / hides the Filter Bar in the grids; gap 21: Indonesian interface shipped, every message but What's New; gap 27: the Windows x64 installer verified on Windows 11; the Settings → Apps uninstall confirmation remains; gap 28: ⌘L Enable Filters switches the filter off and on; gap 15: Japanese photo and postcard paper sizes in the Print page setup and PDF; ISO timestamp parsing rejects incomplete or trailing clock/fraction text; XMP falls back to a valid capture-time property and GPX counts malformed times as untimed; ranked gaps, readiness, and estimates unchanged)
++> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-10-25 · **Change:** minor (gap 8: lens profile work is tracked in #329; gap 30: the Info panel shows the selected photos' shared metadata and marks mixed fields; gap 28: ⌘⌥⇧C / ⌘⌥⇧V copy and paste metadata; gap 13: before a Lightroom catalog import the app asks merge or new library, #2672; gap 28: F8 shows / hides the right panel; import review album hierarchy, #2362; gap 20: Minolta MRW decodes; gap 10: 551 models verified; gap 15: Print Page Options — page numbers, page info, crop marks; gap 28: `\` shows / hides the Filter Bar in the grids; gap 21: Indonesian interface shipped, every message but What's New; gap 27: the Windows x64 installer verified on Windows 11; the Settings → Apps uninstall confirmation remains; gap 28: ⌘L Enable Filters switches the filter off and on; gap 15: Japanese photo and postcard paper sizes in the Print page setup and PDF)
Every known shortfall, one entry each, ranked by user impact (how many Lightroom users hit it, and
how hard it blocks them), then by effort. **Agents pick work from the top** (the first entry nobody is
@@@ -84,7 -84,7 +84,8 @@@ Beta-blocking gaps (B) total **~230–4
| Date | Change | Summary |
|---|---|---|
+ | 2026-10-25 | patch | ISO timestamp parsing rejects incomplete or trailing clock/fraction text; XMP falls back to a valid capture-time property and GPX counts malformed times as untimed; ranked gaps and readiness unchanged |
+| 2026-10-24 | minor | Gap 8: lens profile work is tracked in #329; hours unchanged |
| 2026-10-24 | minor | Gap 28: ⌘⌥⇧C / ⌘⌥⇧V (Ctrl+Alt+Shift+C / V on Windows and Linux) copy and paste metadata; no key leaves the entry; hours unchanged |
| 2026-10-24 | minor | Gap 30 shrinks: the Info panel's Show Metadata For (Target Photo / Selected Photos, `view.infoSelectedPhotos`) shows the selected photos' shared values and marks fields that differ as Mixed; the All Metadata dialog remains; 1–3 h (was 4–8) |
| 2026-10-23 | minor | Gap 13: before a Lightroom catalog import the app asks whether it merges into the open library or goes into a new one (opt-out in Settings, #2672); hours unchanged |
diff --cc docs/parity-checklist.md
index e67b34899,0b9faa6d3..d82ab59ec
--- a/docs/parity-checklist.md
+++ b/docs/parity-checklist.md
@@@ -1,6 -1,6 +1,6 @@@
# Lightroom parity checklist
- > **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-27 · **Change:** minor (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) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6
-> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-25 · **Change:** minor (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; feature counts unchanged) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6
++> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-27 · **Change:** minor (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) · **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
@@@ -165,11 -165,11 +165,11 @@@ differences and missing bindings are i
| Id | Feature | Tier | Status | Evidence | Missing / notes |
|---|---|---|---|---|---|
| LR-META-INFO | Info panel | P0 | ✅ | `cmd:panel.info`, `cmd:photo.setMeta`, `cmd:view.infoSelectedPhotos`, `crates/ui-egui/src/panels/right.rs` (`info`, `camera_card`, `mixed_meta`) | camera card (camera, lens, size, format, focal length / shutter / aperture / ISO); title, caption, alt text, extended description, copyright, copyright status, rights usage terms, copyright info URL, creator; file name (rename), file path (reveal), capture time (edit); location, city, state, country; GPS. With several photos selected, Show Metadata For picks Selected Photos (the default: the values they share; a text field or GPS where they differ is empty and says Mixed, Copyright Status shows Mixed, and only what is typed or picked there is saved, to every selected photo) or Target Photo (the active photo's values; an edit goes to that photo alone). No flash, map snippet or people; a raw with no lens name (Nikon DSLRs) shows its range from Exif LensSpecification or the Nikon maker note's Lens tag, written like Lightroom's `24.0-70.0 mm f/2.8` |
-| LR-META-COPYRIGHT-DEFAULT | Default copyright on import | P1 | ✅ | `cmd:library.preferences` (`import.copyright`, `import.creator`), `crates/ui-egui/src/panels/settings.rs` | Settings → Import → Metadata; fills only photos without their own |
+| LR-META-COPYRIGHT-DEFAULT | Default copyright on import | P1 | ✅ | `cmd:library.preferences` (`import.copyright`, `import.creator`), `crates/ui-egui/src/dialogs/settings.rs` | Settings → Import → Metadata; fills only photos without their own |
| LR-META-LOCATION | Location editing | P2 | 🟡 | `cmd:photo.setMeta` (`location`, `city`, `state`, `country`, `gps`), `cmd:metadata.reverseGeocode` | place fields and GPS (decimal or degrees / minutes / seconds) edited in Info, read/written as IPTC Core / Photoshop / EXIF XMP; Show on Map opens OpenStreetMap; Fill Location fills empty City / State / Country from GPS offline (GeoNames, downloaded on request: `cmd:metadata.downloadPlaceNames`); no embedded map |
| LR-META-COPYPASTE | Copy / paste metadata | P2 | ✅ | `cmd:photo.copyMetadata`, `cmd:photo.pasteMetadata` | title, caption, alt text, extended description, copyright (notice, status, usage terms, info URL), creator, place fields, keywords; `fields` picks a subset |
- | LR-META-XMP | XMP read/write | P0 | ✅ | `cmd:photo.saveMetadataToFile`, `cmd:photo.readMetadataFromFile`, `cmd:library.xmpPreferences`, `crates/engine/src/sidecar.rs`, `docs/xmp-interop.md` | manual rereading also reads sidecar-free JPEG embedded XMP (first complete standard APP1 before SOS/EOI, within 16 MiB of headers and 4096 marker/fill steps; no extended assembly or between-scan packets, not strict whole-JPEG validation; reader cases in `crates/engine/src/sidecar.rs`); a discovered unreadable sidecar fails without embedded fallback; procedural refresh/undo, non-UTF-8 sidecar and two explicit malformed fixtures in `crates/engine/src/tests/xmp.rs` (file-write checks use auto-write off); sidecar wins for metadata; a sidecar capture time (`exif:DateTimeOriginal` / `photoshop:DateCreated` / `xmp:CreateDate`) fills in only when the file has none; keywords are saved as names in `dc:subject` and paths in `lr:hierarchicalSubject` (`keywords::to_file`; before, paths went into `dc:subject`); saving merges into an existing sidecar (`crates/meta/src/xmp_merge.rs`): another app's `crs:`, `xmpMM:History` and unknown namespaces are kept byte for byte (ownership follows namespace URI: foreign namespaces using `lc:` or `xmp:` cannot supply native settings or ratings and survive saving), an unreadable sidecar is backed up first; with stem naming, files sharing a stem (raw + JPEG) get separate sidecars (`<file>.xmp` for all but the raw; an import ranks the files it is adding the same way, so a TIFF or JPEG arriving beside its raw reads its own `<file>.xmp` and never the raw's `IMG_0001.xmp`, issue #1905); a `crs:` custom white balance on a relative-WB raw is shifted from `crs:AsShotTemperature` rather than read as Kelvin, or kept As Shot and reported when the packet has no as-shot white (issue #510); heal and clone spots (`crs:RetouchAreas`, legacy `crs:RetouchInfo`) are read into our spots (`crates/engine/src/crs_masks.rs`, see `docs/xmp-interop.md` → Spot removal); radial masks (`Mask/CircularGradient`) keep Lightroom's inside / outside: `crs:Flipped="true"` is the effect-inside flag of current masks and of the legacy Radial Filter, `crs:MaskInverted` the inversion, checked against Lightroom Classic's renders (issue #1815); Read Metadata from File never writes the sidecar back, even with auto-write on, so another app's later `crs:` edits are still read (issue #934); settings Lightroom writes only for itself (`CompatibleVersion`, the profile digests, the lens profile's name / file / setup, `CropConstrainToUnitSquare`, the lens profile's strength at 100 %) are not reported as unimported (`crates/engine/src/crs.rs`) |
-| LR-META-XMP | XMP read/write | P0 | ✅ | `cmd:photo.saveMetadataToFile`, `cmd:photo.readMetadataFromFile`, `cmd:library.xmpPreferences`, `crates/engine/src/sidecar.rs`, `docs/xmp-interop.md` | manual rereading also reads sidecar-free JPEG embedded XMP (first complete standard APP1 before SOS/EOI, within 16 MiB of headers and 4096 marker/fill steps; no extended assembly or between-scan packets, not strict whole-JPEG validation; reader cases in `crates/engine/src/sidecar.rs`); a discovered unreadable sidecar fails without embedded fallback; procedural refresh/undo, non-UTF-8 sidecar and two explicit malformed fixtures in `crates/engine/src/tests_xmp.rs` (file-write checks use auto-write off); sidecar wins for metadata; a sidecar capture time (`exif:DateTimeOriginal` / `photoshop:DateCreated` / `xmp:CreateDate`) fills in only when the file has none; saving merges into an existing sidecar (`crates/meta/src/xmp_merge.rs`): another app's `crs:`, `xmpMM:History` and unknown namespaces are kept byte for byte (ownership follows namespace URI: foreign namespaces using `lc:` or `xmp:` cannot supply native settings or ratings and survive saving), an unreadable sidecar is backed up first; with stem naming, files sharing a stem (raw + JPEG) get separate sidecars (`<file>.xmp` for all but the raw; an import ranks the files it is adding the same way, so a TIFF or JPEG arriving beside its raw reads its own `<file>.xmp` and never the raw's `IMG_0001.xmp`, issue #1905); a `crs:` custom white balance on a relative-WB raw is shifted from `crs:AsShotTemperature` rather than read as Kelvin, or kept As Shot and reported when the packet has no as-shot white (issue #510); heal and clone spots (`crs:RetouchAreas`, legacy `crs:RetouchInfo`) are read into our spots (`crates/engine/src/crs_masks.rs`, see `docs/xmp-interop.md` → Spot removal); radial masks (`Mask/CircularGradient`) keep Lightroom's inside / outside: `crs:Flipped="true"` is the effect-inside flag of current masks and of the legacy Radial Filter, `crs:MaskInverted` the inversion, checked against Lightroom Classic's renders (issue #1815); Read Metadata from File never writes the sidecar back, even with auto-write on, so another app's later `crs:` edits are still read (issue #934); settings Lightroom writes only for itself (`CompatibleVersion`, the profile digests, the lens profile's name / file / setup, `CropConstrainToUnitSquare`, the lens profile's strength at 100 %) are not reported as unimported (`crates/engine/src/crs.rs`); malformed XMP capture-time values remain in the raw property map and are not projected, allowing the next valid field to supply the capture time |
-| LR-META-EXIF-FULL | Full EXIF/IPTC [Classic] | P1 | ✅ | `cmd:photo.allMetadata`, `cmd:dialog.allMetadata`, `crates/meta/src/tags.rs`, `crates/meta/src/exif.rs`, `crates/meta/src/iptc.rs` | `photo.allMetadata` reuses loaded original bytes for embedded XMP and keeps sidecar precedence (`crates/engine/src/tests_xmp.rs`); read and written on export; Info ▸ All Metadata…: every TIFF / EXIF / GPS / interop tag (named, common values spelled out) and the XMP fields, searchable; PSD/PSB EXIF resource 1058 and XMP resource 1060 feed the same metadata rows and preserve sidecar precedence; metadata presets |
++| LR-META-XMP | XMP read/write | P0 | ✅ | `cmd:photo.saveMetadataToFile`, `cmd:photo.readMetadataFromFile`, `cmd:library.xmpPreferences`, `crates/engine/src/sidecar.rs`, `docs/xmp-interop.md` | manual rereading also reads sidecar-free JPEG embedded XMP (first complete standard APP1 before SOS/EOI, within 16 MiB of headers and 4096 marker/fill steps; no extended assembly or between-scan packets, not strict whole-JPEG validation; reader cases in `crates/engine/src/sidecar.rs`); a discovered unreadable sidecar fails without embedded fallback; procedural refresh/undo, non-UTF-8 sidecar and two explicit malformed fixtures in `crates/engine/src/tests/xmp.rs` (file-write checks use auto-write off); sidecar wins for metadata; a sidecar capture time (`exif:DateTimeOriginal` / `photoshop:DateCreated` / `xmp:CreateDate`) fills in only when the file has none; keywords are saved as names in `dc:subject` and paths in `lr:hierarchicalSubject` (`keywords::to_file`; before, paths went into `dc:subject`); saving merges into an existing sidecar (`crates/meta/src/xmp_merge.rs`): another app's `crs:`, `xmpMM:History` and unknown namespaces are kept byte for byte (ownership follows namespace URI: foreign namespaces using `lc:` or `xmp:` cannot supply native settings or ratings and survive saving), an unreadable sidecar is backed up first; with stem naming, files sharing a stem (raw + JPEG) get separate sidecars (`<file>.xmp` for all but the raw; an import ranks the files it is adding the same way, so a TIFF or JPEG arriving beside its raw reads its own `<file>.xmp` and never the raw's `IMG_0001.xmp`, issue #1905); a `crs:` custom white balance on a relative-WB raw is shifted from `crs:AsShotTemperature` rather than read as Kelvin, or kept As Shot and reported when the packet has no as-shot white (issue #510); heal and clone spots (`crs:RetouchAreas`, legacy `crs:RetouchInfo`) are read into our spots (`crates/engine/src/crs_masks.rs`, see `docs/xmp-interop.md` → Spot removal); radial masks (`Mask/CircularGradient`) keep Lightroom's inside / outside: `crs:Flipped="true"` is the effect-inside flag of current masks and of the legacy Radial Filter, `crs:MaskInverted` the inversion, checked against Lightroom Classic's renders (issue #1815); Read Metadata from File never writes the sidecar back, even with auto-write on, so another app's later `crs:` edits are still read (issue #934); settings Lightroom writes only for itself (`CompatibleVersion`, the profile digests, the lens profile's name / file / setup, `CropConstrainToUnitSquare`, the lens profile's strength at 100 %) are not reported as unimported (`crates/engine/src/crs.rs`); malformed XMP capture-time values remain in the raw property map and are not projected, allowing the next valid field to supply the capture time |
+| LR-META-EXIF-FULL | Full EXIF/IPTC [Classic] | P1 | ✅ | `cmd:photo.allMetadata`, `cmd:dialog.allMetadata`, `crates/meta/src/tags.rs`, `crates/meta/src/exif.rs`, `crates/meta/src/iptc.rs` | `photo.allMetadata` reuses loaded original bytes for embedded XMP and keeps sidecar precedence (`crates/engine/src/tests/xmp.rs`); read and written on export; Info ▸ All Metadata…: every TIFF / EXIF / GPS / interop tag (named, common values spelled out) and the XMP fields, searchable; PSD/PSB EXIF resource 1058 and XMP resource 1060 feed the same metadata rows and preserve sidecar precedence; metadata presets |
## F. Edit panel — global adjustments (EDIT)
@@@ -799,7 -799,7 +799,8 @@@ Latin stays upright. Advanced Japanese
| Date | Change | Summary |
|---|---|---|
+| 2026-10-25 | patch | LR-BEHAV-TITLEBAR: the top bar's title-bar gestures come from craft-window's `title_bar`: a double-click follows the system setting, and a press on a button, the search field or a panel floating over the bar never moves the window; status counts unchanged |
+ | 2026-10-25 | patch | LR-META-XMP and LRC-MAP-TRACKLOG reject incomplete ISO timestamps: XMP capture-time fallback remains available and malformed GPX times are untimed; status and feature counts unchanged |
| 2026-10-24 | minor | KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 (`keyword.nextSet`, `keyword.previousSet`) go to the next / previous keyword set; status counts unchanged (KEYC-METADATA stays 🟡) |
| 2026-10-24 | minor | KEYC-METADATA: ⌘K / Ctrl+K (`panel.addKeywords`, Add Keywords) shows the Keywords panel, opens Keywording and puts the cursor in the Add keyword box; status counts unchanged (KEYC-METADATA stays 🟡) |
| 2026-10-24 | patch | LR-LIB-RATING, LR-LIB-DELETE: a slider drag still open when a rating, flag or label takes the photo out of the view, or when the photo is deleted, ends as its own undo step before the selection moves on, as moving to the next photo does; LR-BEHAV-LOCALIZE lists all 18 languages; status unchanged |
diff --cc docs/whats-new.md
index 07c107ba0,379e62356..0559045c3
--- a/docs/whats-new.md
+++ b/docs/whats-new.md
@@@ -1,26 -1,14 +1,31 @@@
# What's new in LightCraft
+## 2026-10-27
+
+### The Edit menu groups Select Only Active Photo and Paste Settings from Previous with their kin
+- Select Only Active Photo now sits under Deselect All, and Paste Settings from Previous under Paste Selected Settings…, instead of both after Settings…, near the end of the Edit menu. On macOS, where Settings… lives in the application menu, the Edit menu no longer shows two separator lines in a row.
+
## 2026-10-25
+### `>=` and `<=` work in the search box
+- Fielded search tokens now take inclusive comparisons: `rating:>=3`, `iso:<=400`, `f:>=2.8`, `focal:<=50`. Before,
+ the `=` was read as part of the number, so such a search quietly showed no photos at all.
+
+ ### Incomplete timestamps no longer become plausible photo times
+ - An ISO date ending in `T`, a clock with extra components, or a malformed fractional second is no longer read as a
+ different valid time. XMP keeps the original property available and can use the next valid capture-time field;
+ GPX treats an invalid point time as untimed, so it cannot tag a photo at a fabricated time.
+
## 2026-10-24
+### Sidecar keywords stay searchable in other applications
+- Saving an XMP sidecar wrote each keyword's path into `dc:subject`, so after any change, even a star rating, a
+ photo keyworded `Places|Italy|Rome` listed `Places|Italy|Rome` there instead of `Places`, `Italy` and `Rome`,
+ and a search for "Rome" in Lightroom, darktable, digiKam or another DAM no longer found it. Sidecars now get the
+ names in `dc:subject` and the paths in `lr:hierarchicalSubject`, as Lightroom Classic writes them, and LightCraft
+ reads them back as the same keywords. A sidecar written by an earlier version is put right the next time it is
+ saved.
+
### Relative-date filters and smart albums follow the clock
- A current view or source count using “in the last” rules now refreshes when the session clock moves into a new
minute, even when no catalog edit occurred. This fixes stale photos remaining in the grid and stale counts for