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.

Participating Frequently
September 23, 2022

Adobe Camera Raw is exactly how it should work. It gives users the choice. Lightroom does not. In Adobe Camera Raw, you can pick to save the edits to the DNG, or you can choose to only use sidecars. In Lightroom, you don't have a choice. It picks for you, and it picks inconsistently. If the timestamp on the XMP is newer than the timestamp on the DNG, it reads from it, and, as you put it, trashes the user's metadata from the DNG.

 

You can recreate the problem I am having using only Adobe software using the below steps.

 

  1. Set Camera Raw to ony use sidecars
  2. Set Lightroom to save edits to xmp
  3. Edit photo in Adobe Camera Raw
  4. Close the photo and reopen in Adobe Camera Raw (this confirms that is saved and read your edits from the XMP)
  5. Rate photo in Lightroom (this results in the modified date of the DNG being updated)
  6. Reopen photo in Camera Raw
  7. See that you just lost your Camera Raw edits

 

If Lightroom had the same ability for the user to choose to use sidecars or to save to DNG as Camera Raw, there would be no issue, but as you can see Lightroom's inablitly to allow the user to chose causes the user to lose edit information whether or not they are editing the XMP with a third part app.

 


I think the difference in the results between these to workflows best displays the issue.

 

Adobe Camera Raw/Mylio

  1. Edit photo in Adobe Camera Raw saving edits to XMP
  2. Close photo
  3. Rate photo in Mylio
  4. Open photo in Camera Raw
  5. Edits are retained and rating is retained

 

Lightroom/Mylio

  1. Edit Photo in Lightroom saving edits to file
  2. Rate photo in Mylio
  3. Read metadata from photo in Lightroom
  4. Edits are lost rating is retained

 

There should be a way to have Lightroom function in the same way as Camera Raw for this scenario.

 

That could be accomplished by giving the user the option to chose to write their edits in the sidecar file, or by making the behavior consistent with either RAW files or with TIF/JPG.

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).