Repository navigation
Issue #3434: Lightroom import gives the photos it adds the catalog's settings, not their file's XMP #3435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #3434: Lightroom import gives the photos it adds the catalog's settings, not their file's XMP #3435
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1022,6 +1022,11 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co | |
| refuse_non_media(&mut data); | ||
| validate(&data).map_err(error)?; | ||
| let mut warnings = data.warnings.clone(); | ||
| // Records this import has just added, or promoted from Local untouched since browsing, hold | ||
| // no edits of the library's own, even when adding or browsing read develop settings from the | ||
| // file's XMP: the catalog's settings apply to them. | ||
| let changed: HashSet<_> = files.promoted_changed.iter().collect(); | ||
| let added: HashSet<_> = files.imported.iter().filter(|id| !changed.contains(id)).copied().map(PhotoId).collect(); | ||
| let duplicates: HashMap<_, _> = | ||
| files.duplicates.iter().filter_map(|d| d.existing.map(|id| (key(&d.path), (PhotoId(id), d.file.as_deref())))).collect(); | ||
| let mut by_path: HashMap<_, _> = | ||
|
|
@@ -1150,11 +1155,20 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co | |
| } | ||
| ids.insert(src.source_id, p.id); | ||
| index.photos.insert(identity(&data, src), p.id.0); | ||
| let keep_develop = existing_id.is_some() && p.edited.is_some() && !update_existing; | ||
| // A record this import added, or a Local one untouched since browsing (an offline original | ||
| // never reaches the add step, so it is judged here), holds no edits of the library's own. | ||
| let fresh = existing_id.is_some_and(|id| added.contains(&id) || s.catalog.photo(id).is_some_and(|q| q.untouched_local())); | ||
| let keep_develop = existing_id.is_some() && !fresh && p.edited.is_some() && !update_existing; | ||
| let previous_develop = (p.develop.clone(), p.edited.clone()); | ||
| if keep_develop { | ||
| preserved += 1; | ||
| } | ||
| // Lightroom leaves some settings at zero (Clarity, Texture) out of its develop text, so the | ||
| // catalog's settings start from the camera's defaults, not from what the file's XMP (or a | ||
| // default import preset) gave the photo. With no develop text there is nothing to replace. | ||
| if fresh && !src.settings.is_empty() { | ||
| p.develop = Arc::new(p.camera_defaults()); | ||
|
Comment on lines
+1169
to
+1170
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
| let orientation = lightroom_orientation(text(&src.image, "orientation")).unwrap_or_default(); | ||
| let stored_aspect = number(&src.image, "fileWidth") as f64 / number(&src.image, "fileHeight") as f64; | ||
| if !src.xmp.is_empty() { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.