Skip to main content
johnrellis
Genius
September 15, 2022
해결됨

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

  • September 15, 2022
  • 2 답변들
  • 5387 조회

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

 

이 주제는 답변이 닫혔습니다.
최고의 답변: 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 답변

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.

johnrellis
johnrellis작성자
Genius
September 28, 2022
quote

As I stated above. I am not requesting that feature.  The reason for the feature request is entirely different than this issue.

By @FercStar

 

The feature request from 8 years ago (and 36 votes) you provided us today? 

 

I do not wish to stop using Lightroom. I simply want the issue I have raised to be taken seriously.

 

Maybe start by actually posting the feature request you desire and stop arguing with the fellow who invented the technology that might provide you the feature you haven't correctly requested yet:


My core belief is that if you're complaining about something for more than three minutes, two minutes ago you should have done something about it.“ -Caitlin Moran

 

Make a feature request; that's about all you can now do:

https://community.adobe.com/t5/photoshop-ecosystem-ideas/how-do-i-write-a-feature-request/idi-p/12384447


By @TheDigitalDog

 


[This post contains formatting that doesn't appear in email. View the post in your Web browser.]

 

I think it's safe to say that this thread contradicts the prior received wisdom in this forum about LR and DNG sidecars. @Thomas Knoll clarified that Camera Raw will read metadata from DNG sidecars depending on preference settings, but he didn't provide an explanation or design rationale for some of Lightroom Classic's behaviors. So I'll try to document LR's behavior and show how it fits in with Camera Raw; as always, I'd love to have any mistakes corrected.

 

Camera Raw has three options for the preference DNG File Handling > Sidecars.  The Help is long out-of-date, but reverse engineering indicates the following meanings:

 

Embed XMP in DNG: If a sidecar exists, it is read; otherwise the metadata is read from the DNG.  But when the image is closed, the metadata is always written into the DNG and any sidecar is deleted.

 

Always use sidecar XMP files: If a sidecar exists, it is read; otherwise the metadata is read from the DNG.  But when the image is closed, the metadata is written to the sidecar and the DNG is left untouched.

 

Ignore sidecar XMP files: The metadata is never read from or written to sidecars if they exist.  Metadata is only read from and written to the DNG.

 

Lightroom Classic always uses the option Embed XMP in DNG, meaning it will read metadata from an existing sidecar, but unlike Camera Raw, it doesn't delete an existing sidecar when the user does Metadata > Save Metadata To File.  To the chagrin of some users, LR doesn't provide the other two Camera Raw options.

 

Since LR will read an existing DNG sidecar but not write it, it kinda-sorta makes sense that the Metadata panel's Sidecars field will always be blank regardless of the presence of a sidecar. In general, the Sidecars field will indicate a sidecar only if it will write it. But it sure is confusing for LR to read metadata from the sidecar but not display the sidecar in the Sidecars field.

 

What about the fact that LR will sometimes only read a sidecar if its newer than a DNG?  It's complicated.

 

When there's a sidecar present, and one of the options Embed XMP in DNG or Always use sidecar XMP files is selected, then the sidecar's metadata is read only if Camera Raw determines that metadata is newer than any XMP metadata in the DNG.  In particular, it will read the sidecar if:

 

- The DNG doesn't contain any XMP metadata; or

 

- The sidecar contains the undocumented Adobe-proprietary field photoshop:EmbeddedXMPDigest and the contents of that field (an MD5 hash) matches the hash of the current XMP metadata in the DNG; or

 

- The sidecar doesn't contain the field photoshop:EmbeddedXMPDigest and the sidecar's last-modified date is newer than that of the DNG.

 

This algorithm ensures that if another app modifies the metadata in the DNG, any existing sidecar will then be recognized as "stale" and won't be read. (It's similar to the algorithm defined by the Metadata Working Group standard for determining whether to read fields from XMP or IPTC-IIM.)

 

This is why sidecars produced by the Mylio app would only be read if they were newer than the DNG -- they didn't contain photoshop:EmbeddedXMPDigest.

 

 

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