# I need help understanding .xmp sidecar files



## JenniD (Mar 4, 2019)

I'll try to keep this short...

I had an EHD crash a couple of years ago and all of the Lightroom files were/are in a Lightroom 4 catalog. I restored everything from a backup onto a new EHD and have just gotten around to going through the files in that catalog and pointing them to the correct folders ('find missing folder' in LR) in the new EHD, because I created a new catalog after the crash to keep things separate. 

I've noticed for *some, but not all*, .xmp files are being created in the folders on my EHD. This happens periodically when I look an NEF file from the EHD and it opens in photoshop. When I go back to the file in the EHD there might be an xmp file along side of the original.* Again, sometimes, not always.*

Also, just to note, I get one of  three different types per image that it decides to give an xmp file to...

One looks like a white sheet of paper and is blank, one looks like a white sheet of paper that has text and one is a black box that has exec in green letters in the upper left corner. 

So my question is this (multi-parts):

Am I doing something wrong? Is there a way to avoid all of these extra .xmp files from showing up? Can I delete them?


----------



## clee01l (Mar 4, 2019)

The XMP is a section of the file header or a sidecar file that holds some (but not all) metadata about the image.   If you have "Automatically write changes to XMP" checked in the Metadata section of  Catalog preferences, a XMP sidecar file will be created whenever the file type (proprietary RAW, e.g NEF) file is the master image file. With JPEGs and DNGs the XMP section is in the header.
Another time an XMP sidecar file is created is when you send the image from a proprietary RAW file to Photoshop.   Lightroom needs to pass the LR develop settings to Photoshop and this is the accepted mechanism.

You can delete them since all of the metadata (not just the part saved in the XMP file) is maintained in your LR catalog file  and a recent catalog file backup.


----------



## Johan Elzenga (Mar 4, 2019)

clee01l said:


> Another time an XMP sidecar file is created is when you send the image from a proprietary RAW file to Photoshop. Lightroom needs to pass the LR develop settings to Photoshop and this is the accepted mechanism.


I don’t think that is true. Lightroom does indeed send develop instructions to Photoshop, so the image can be processed by Camera Raw without showing the ACR dialog, but AFAIK it does not do so by creating an XMP file.


----------



## JenniD (Mar 5, 2019)

Thanks to both of you! Looks like I can delete them, then. I currently use Lightroom exclusively, but should I start using Photoshop, I will revisit this.


----------



## clee01l (Mar 5, 2019)

JohanElzenga said:


> I don’t think that is true. Lightroom does indeed send develop instructions to Photoshop, so the image can be processed by Camera Raw without showing the ACR dialog, but AFAIK it does not do so by creating an XMP file.


I am working from a fading memory here.  There is an instance where LR creates XMP files before shelling out to another process.  If not when calling Photoshop, then when creating an HDR or Panorama.


----------



## Johan Elzenga (Mar 5, 2019)

clee01l said:


> I am working from a fading memory here.  There is an instance where LR creates XMP files before shelling out to another process.  If not when calling Photoshop, then when creating an HDR or Panorama.


I vaguely remember that too, but I checked those as well and I see no XMP files with my HDR brackets or panorama shots either.


----------



## PhilBurton (Mar 5, 2019)

JohanElzenga said:


> I don’t think that is true. Lightroom does indeed send develop instructions to Photoshop, so the image can be processed by Camera Raw without showing the ACR dialog, but AFAIK it does not do so by creating an XMP file.


Johan,

Does anyone know the mechanism to LR uses to send develop instructions to PS?  Is that public?  If one of the developer people could answer this question, maybe, just maybe, that information could turn into a plug-in that could be used to export history.  Maybe????

Or am I misunderstanding all of this?


----------



## Johan Elzenga (Mar 5, 2019)

PhilBurton said:


> Johan,
> 
> Does anyone know the mechanism to LR uses to send develop instructions to PS?  Is that public?  If one of the developer people could answer this question, maybe, just maybe, that information could turn into a plug-in that could be used to export history.  Maybe????
> 
> Or am I misunderstanding all of this?


I think you do. I do not see what that info has to do with the history. I don’t know the exact details of how Lightroom sends the info to Photoshop (I assume it’s like an XMP file, but only in memory), but I am sure it does not send the history because the history is totally irrelevant when you open an image from Lightroom in Photoshop.


----------



## PhilBurton (Mar 6, 2019)

JohanElzenga said:


> I think you do. I do not see what that info has to do with the history. I don’t know the exact details of how Lightroom sends the info to Photoshop (I assume it’s like an XMP file, but only in memory), but I am sure it does not send the history because the history is totally irrelevant when you open an image from Lightroom in Photoshop.


OK.  Thanks.


----------



## Califdan (Mar 6, 2019)

As I understand (or a least guess), when you send an image from LR to PS, it first does an Export to a temporary folder.  That export (in whatever file type you specified in your preferences) has the LR adjustments applied to the pixels in the file so no other information is needed..  That image is then opened in PS .  When the image in PS is closed,  PS  does a save operation over writing the file that LR  had given it  which now also includes the PS changes as changed pixels and LR then "sync's" the images preview with the new look from PS.  

I have no real knowledge of this, but is the way I always assumed it worked and, indeed it does seem to behave this way.


----------



## Johan Elzenga (Mar 6, 2019)

Califdan said:


> As I understand (or a least guess), when you send an image from LR to PS, it first does an Export to a temporary folder.  That export (in whatever file type you specified in your preferences) has the LR adjustments applied to the pixels in the file so no other information is needed..  That image is then opened in PS .  When the image in PS is closed,  PS  does a save operation over writing the file that LR  had given it  which now also includes the PS changes as changed pixels and LR then "sync's" the images preview with the new look from PS.
> 
> I have no real knowledge of this, but is the way I always assumed it worked and, indeed it does seem to behave this way.


No, that is not how this works. Lightroom instructs Photoshop to open the raw image, using ACR (but the ACR dialog is suppressed). That is why you get the famous version mismatch warning if ACR is older than the version that is used in Lightroom. In that case Lightroom could send an instruction to ACR that this older version of ACR does not support yet. And so one of the options in this dialog is to let Lightroom render the image instead of ACR. If Lightroom exported the image to a temporary folder, then the ACR version would be completely irrelevant and so you would never get this warning.


----------



## Califdan (Mar 7, 2019)

I see what you are saying.    But was confused as you description did not mach my observations.    I turns out that I was letting  LR render the image rather than ACR.   It seems to behave the way you say if you let ACR render the image.    PS opens the  original CR2 (in my case) but somehow has the adjustments applied.   

However, if you tell it to "Render using Lightroom"  then it works the way I described.    A new PSD (in may case) image file show s up in the same folder as my original CR2 the instant I click the  "Render in Lightroom" button (even though PS hasn't even  launched yet)?  This new file has the same base file name as the CR2  but with "-edit" appended to the base name and the file type I specified in my preferences.     Once the image opens in PS, the file name and path in this opened image is the one created when I clicked  "Render in Lightroom".    Then when I close the image in PS after doing the edits, it is this PSD that it is asking if I want to save and that is the image which winds up in my grid - stacked with the original CR2.    

So, it looks like we were both right but still doesn't answer the question as to how the LR edits get known to PS in you let ACR render the image.  I always have XMP's si can't tell if it would generate an XMP for ACR to use even if I didn't have that option set.   A test for another day.

Thanks -- Dan


----------



## Jim Wilde (Mar 7, 2019)

Califdan said:


> So, it looks like we were both right but still doesn't answer the question as to how the LR edits get known to PS in you let ACR render the image.  I always have XMP's si can't tell if it would generate an XMP for ACR to use even if I didn't have that option set.   A test for another day.


There is a special system-level interface between Lightroom and PS which is used for this purpose. I used to remember what it was called, but I'm sure Victoria will still know.  

To be clear though, as Johan mentioned, the "Render Using Lightroom/Open Anyway" option dialog will only appear when there is a mis-match between the ACR versions used by Lightroom and PS *and* the PS version is older than the LR version. For users of the current Photography plan, there is no reason why any subscriber should ever see that dialog again.

My understanding is that when the ACR versions are aligned, or the PS version is newer than the LR version, the data is passed via that interface to ACR which renders the raw file, with adjustments, into the system cache. Only when the file is then saved in PS is it written to disk.


----------



## Victoria Bampton (Mar 9, 2019)

Jim Wilde said:


> There is a special system-level interface between Lightroom and PS which is used for this purpose. I used to remember what it was called, but I'm sure Victoria will still know.


Last time I checked, it was using a scripting language called BridgeTalk. It's years since I last checked, but I doubt that's changed.


----------



## Jim Wilde (Mar 9, 2019)

Yep, I knew you'd remember!


----------

