Repository navigation
Closed as duplicate
Closed as duplicate
Copy link
Labels
bugSomething isn't workingduplicateThis issue or pull request already existsin progresspriority: high
Description
Follows #2589 (PRs #3141, #3142).
Summary
A Lightroom catalog import can add a photo's file itself, when the file is on disk and not yet in the library. If that file has an XMP sidecar with develop settings, the new record keeps the sidecar's settings and the catalog's settings are ignored, unless "update existing" is on. The report also counts the photo under preservedExistingEdits, although nothing existed before the import.
- Wrong edit: the catalog is the Lightroom user's edit. A sidecar can be older than the catalog: Lightroom writes it only when "Automatically write changes into XMP" is on, or when someone saves metadata to the file. Whatever the sidecar says then wins over the edit the user made in Lightroom.
- Wrong report: "kept N existing edits" tells the user that LightCraft protected edits they had made. None existed.
- With "update existing" on, the catalog's settings apply. The same new photo then comes out differently depending on an option that is only meant for records already in the library.
Evidence (main 4d2fa12)
A probe test on main ac1799d (a file test.ARW plus test.xmp with crs:Exposure2012="+2.00" crs:Vibrance="+30", and a catalog photo at that path with Exposure2012 = -1.0) gives:
update_existing = false: exposure 2, vibrance 30,preservedExistingEdits1,imported1.update_existing = true: exposure -1,preservedExistingEdits0.
How it happens:
crates/engine/src/lightroom_job.rscommit_preparedruns the normal file import first, thenapply_prepared.crates/engine/src/sidecar.rs:354: the file import merges the sidecar into the new record, and its develop settings setp.edited.crates/engine/src/lightroom_catalog.rs:1027/:1064:apply_preparedbuildsby_pathfrom the library after that commit, so the catalog photo finds the record the file import just made asexisting_id.crates/engine/src/lightroom_catalog.rs:1153:keep_develop = existing_id.is_some() && p.edited.is_some() && !update_existingis then true. The catalog's settings are skipped (:1185), the catalog XMP's develop is reverted (:1204) andpreservedis incremented.
What a fix needs
apply_preparedhas to know which records this import made.files.importedisn't enough: it also lists photos browsed in Local that the import promotes (PreparedItem::Promote). Those existed before the import and can carry the user's own edits.- A record this import made gets the catalog's develop settings on top of what the file import gave it, as the content-duplicate branch already does. It isn't counted in
preservedExistingEdits. - A record that existed before the import (in the library, or browsed in Local) keeps today's behaviour: its edit stays unless "update existing" is on.
- Test: through the job's real route (
ImportJob::prepare_files+lightroom_job::commit_prepared), with a file plus a develop sidecar, for no prior record, a library record with an edit, and a Local record with an edit.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingduplicateThis issue or pull request already existsin progresspriority: high
Activity
ticket-craft commentedon Nov 3, 2026
Possible duplicate of #3434.
This is being worked on in #3435.
THEtheChad commentedon Nov 4, 2026
Duplicate of #3434, filed earlier with the same bug. Both are fixed by #3737 (issue #3736).
fix(engine): storytold#3707 a Lightroom import develops the records i…
refactor(engine): one origin per record for a Lightroom import job
fix(engine): storytold#3707 a Lightroom import develops the records i…
refactor(engine): one origin per record for a Lightroom import job
fix(engine): storytold#3707 a Lightroom import develops the records i…
refactor(engine): one origin per record for a Lightroom import job
fix(engine): storytold#3707 a Lightroom import develops the records i…
refactor(engine): one origin per record for a Lightroom import job
fix(engine): storytold#3707 a Lightroom import develops the records i…
refactor(engine): one origin per record for a Lightroom import job
fix(engine): storytold#3707 a Lightroom import develops the records i…
refactor(engine): one origin per record for a Lightroom import job