Skip to main content
johnrellis
Legend
September 15, 2022
Answered

P: LrC reads metadata for a DNG from an associated sidecar

  • September 15, 2022
  • 2 replies
  • 5455 views

When LR imports a DNG, if there is a .xmp sidecar of the same file name, LR will incorrectly read metadata from the sidecar, but only if the date-modified of the .xmp file is newer than that of the .dng.  Similar behavior occurs with Metadata > Read Metadata From File. 

 

LR should never read metadata for a DNG from a .xmp sidecar (just as it doesn't for JPEG, TIFF, and other non-raw formats). And note that for sidecars of raw files, the sidecar is always read regardless of whether its date-modified is newer or older than the associated raw file.

 

See this thread for the original report of the problem.


Tested on LR 11.5 / Mac OS 12.4.  Steps to reproduce:

 

1. Disable the option Catalog Settings > Metadata > Automatically Write Changes Into XMP.

 

2. Download  a.xmp and a.dng into the same folder.

https://www.dropbox.com/s/n9kpqeddqtff83p/dng-xmp.2022.09.16.zip?dl=0

 

3. In Mac Terminal, do the command "touch a.dng"; on Windows, do "copy a.dng + nul a.dng".  These commands will set the date-modified of a.dng to "now", newer than a.xmp.

 

4. Import a.dng with the Add option.

 

5. Select a.dng and observe that the Metadata panel's Sidecar Files field is blank.

 

6. Observe that a.dng is black & white with no label or rating (correct).

 

7. Remove a.dng from the catalog.

 

8. In Mac Terminal, do the command "touch a.xmp"; on Windows, do "copy a.xmp + nul a.xmp".  These commands will set the date-modified of a.xmp to "now", newer than a.dng.

 

9. Import a.dng with the Add option.

 

10. Select a.dng and observe that the Metadata panel's Sidecar Files field is blank.

 

11. Observe that a.dng is color, not black & white, and it has a red label and rating = 2, indicating that LR has read metadata from a.xmp (incorrect).

 

This topic has been closed for replies.
Correct answer Thomas Knoll

This is expected behavor as far as Adobe is concerned.  

If Mylio does not want the sidecar file to be attached to the ".DNG" file, but instead a file with a different extension but the same name, is should be including the "photoshop:SidecarForExtension" tag inside the .XMP sidecar.  If this tag exists and does not specify "DNG", then Adobe software will then ignore the sidecar when reading DNG files.

2 replies

Thomas KnollCorrect answer
Adobe Employee
September 21, 2022

This is expected behavor as far as Adobe is concerned.  

If Mylio does not want the sidecar file to be attached to the ".DNG" file, but instead a file with a different extension but the same name, is should be including the "photoshop:SidecarForExtension" tag inside the .XMP sidecar.  If this tag exists and does not specify "DNG", then Adobe software will then ignore the sidecar when reading DNG files.

Participating Frequently
September 21, 2022

From what I can see, there are three separate behaviors when reading metadata from XMP.

 

1 - TIF, PNG, JPG - only read from the file not from a sidecar

2 - RAW (cr2, arw, etc) only read from xmp not from the file

3 - DNG read from whichever has the most recent modified date

 

Behaviors 1 and 2 make sense, but behavior 3 does not.

 

DNGs should receieve the same treatment as either proprietary raw formats and get edits written to a sidecar and read from a sidecar, or they should get the same treatment as open format files and have their edits written and read from the file ignoring sidecars.

 

The inconsistent behavior of the DNG is a problem and it is hard for me to see how having a special behavior for DNG is the "expected behavior."

 

If the behavior for a DNG is correct then the behavior for TIF, PNG, and JPG is incorrect. If the behavior for TIF, PNG, and JPG is correct, then the behavior for DNG is incorrect.

Adobe Employee
September 22, 2022

Since I invented both DNG format and XMP sidecar files for raw formats, I think I get to define what is correct.

Sidecar XMP files for DNG format are prefered by many users because it works more effiently with their file backup and multiple machine file syncronization workflows.  Camera Raw offers a user preference for how metadata should be handled for DNG format when saving metadata (prefer to embed, or prefer to use sidecar).   Before this preference existed, users would force the use of XMP sidecar for DNG format by just marking the DNG files as read only at the file system level.

So there are a very large number of DNG files with XMP sidecar files already in existence for many users.  Your proposal to always ignore sidecar XMP files for DNG format would be all these users would lose their Camera Raw settings for this DNG files.  Sorry, but I'm not trash all these users metadata just to work around a bug in some non-Adobe software.

Participating Frequently
September 15, 2022

I often edit my photos on mulitple computers, so I have the setting "Automatically Write Changes to XMP" turned on. With proprietary raw formats this works great because it saves the edit info to an XMP sidecar, but with DNG, TIFFs, etc., it saves the edits to the file.

 

This creates a problem when the file has an XMP sidecar as well. When Lightroom reads the metadata from the file, it prefers the XMP over the DNG. This means, that it will ignore edits made to the DNG and reset all of the edits. From what I can tell, there is no option to change this.

 

I understand the Lightroom doesn't write metadata to an XMP for DNGs, but if it won't write to the XMP, why does it read from the XMP instead of the DNG? This essentially breaks mutliple device workflows using DNGs, or TIFFs. Lightroom should either allow writing to XMP sidecars for DNGs, prefer the metadata in the DNG over the XMP, give the user a choice which file to use, or merge the metadata between the two.

JohanElzenga
Community Expert
Community Expert
September 15, 2022

Why do your DNG files have a sidecar file in the first place? Where does it come from?

 

-- Johan W. Elzenga
Participating Frequently
September 15, 2022

They are created by another app (specifically Mylio which synchronizes my library to multiple devices).