Skip to content

Lightroom import: a photo whose file the import adds keeps its XMP sidecar's develop settings, not the catalog's #3707

Closed as duplicate

Description

@THEtheChad

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, preservedExistingEdits 1, imported 1.
  • update_existing = true: exposure -1, preservedExistingEdits 0.

How it happens:

  • crates/engine/src/lightroom_job.rs commit_prepared runs the normal file import first, then apply_prepared.
  • crates/engine/src/sidecar.rs:354: the file import merges the sidecar into the new record, and its develop settings set p.edited.
  • crates/engine/src/lightroom_catalog.rs:1027 / :1064: apply_prepared builds by_path from the library after that commit, so the catalog photo finds the record the file import just made as existing_id.
  • crates/engine/src/lightroom_catalog.rs:1153: keep_develop = existing_id.is_some() && p.edited.is_some() && !update_existing is then true. The catalog's settings are skipped (:1185), the catalog XMP's develop is reverted (:1204) and preserved is incremented.

What a fix needs

  • apply_prepared has to know which records this import made. files.imported isn'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.

Activity

  1. added
    bug
    duplicate
    on Nov 3, 2026
  2. ticket-craft commented on Nov 3, 2026

    @ticket-craft

    Possible duplicate of #3434.

    This is being worked on in #3435.

  3. THEtheChad commented on Nov 4, 2026

    @THEtheChad
    ContributorAuthor

    Duplicate of #3434, filed earlier with the same bug. Both are fixed by #3737 (issue #3736).

  4. added 2 commits that reference this issue on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugduplicatein progresspriority: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions