Transfer meta data from proprietary third party RAW side car (dop) into xmp

Started by Sandersoni, January 16, 2022, 05:45:35 PM

Previous topic - Next topic

Sandersoni

I moved away from Adobe and need to update my workflow. DxO PhotoLabs 5 is saving edits and meta data in their own .dop sidecar (which is an xmp file in anything but extension, see sample attachment). After ratings (xmp) and processing (dop) i end up with these files:

  • P1187890.RW2
  • P1187890.XMP
  • P1187890.JPG
  • P1187890.RW2.dop

One of the tags/labels in the .dop file that i am interested in seeing in a contact sheet browser (i.e. Photo Mechanic or First RAW Viewer) is the processing status of an image:

  • Processing Status tag not present
  • Processing Status = 1 [raw edits made, .dop has being created]
  • Processing Status = 3 [the image has been processed/exported]

How can I transfer the processing status tag into the XMP?
I would like to translate the processing status into a colour label, i.e. if processing status = 3, then xmp colour label = green.
The extra '.rw2' naming syntax is another stumbling block.
Is this possible with ExifTool?

I previously worked with Adobe Camera Raw and to flag the presence of RAW edits I ran an EXIFTool script that sets the colour label based on the filesize of the xmp (above a certain size = RAW edits present).

StarGeek

That dop file doesn't look like an XMP file at all.

Exiftool doesn't see it as anything except a text file.  You're probably going to have to script something to parse out the info you want.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Sandersoni

Oh, bummer! Thank you for your response!
Another option would be create an xmp tag if a .dop sidecard is present.

Phil Harvey

Where do you want to create the XMP tag?  If in the RW2 file, as an example, writing the .DOP file name to the Subject tag would look like this:

exiftool -tagsfromfile %f.dop "-subject<filename" -ext rw2 DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Sandersoni

Thank you for your help!

I had another look at this tonight.
I want to create a batch command for RAWs in a folder and mark their processing status.
The easiest would be:

Scenario 1: No .dop sidecar, do nothing (raw not processed).

  • P1187890.RW2
  • P1187890.XMP
  • P1187890.JPG
Scenario 2: if .dop sidecar present, create/write tag in existing xmp sidecar, or create if doesn't exist already, to indicate that the raw file has been processed.

  • P1187891.RW2
  • P1187891.XMP <--- create <xmp:Label>Green</xmp:Label> in this XMP side car
  • P1187891.JPG
  • P1187891.RW2.dop <-- present
I'd prefer to create the XMP tag in a side car, writes less data.
The double extension naming syntax ('rw2.dop') of the .dop file is throwing me off.

Sandersoni

As a work around, i created a Python script that changes the colour label tag to GREEN (from RED) in the XMP, if a .DOP sidecar is present for all files in the folder.
Attached if useful to anyone else.

I will expand it to (1) create a new XMP if none found and (2) maybe look into the content of the DOP ('processing status = 3'), rather then just check for the presence of the .DOP.

Joanna Carter

Quote from: Sandersoni on January 16, 2022, 05:45:35 PM
DxO PhotoLabs 5 is saving edits and meta data in their own .dop sidecar (which is an xmp file in anything but extension

In fact, the .dop file is closest to a JSON file, but with irregular syntax, like list delimiters after the last item in a list and the use of curly braces instead of square braces surrounding lists, etc. I started writing code to parse it into a dictionary, with extensive use of Regex to search and replace but, after several attempts, there were still parts that broke the rules for true JSON.

Quote from: Sandersoni on January 16, 2022, 05:45:35 PM
I would like to translate the processing status into a colour label, i.e. if processing status = 3, then xmp colour label = green.

Be aware that DxO has publicly mentioned its desire to integrate coloured labels, which might upset the use you are planning on making of them.

Sandersoni

Thank you, Joanna.
Yes, there seems to be alot of movement by DxO on their dop format.
Hence, had to go for this lowest common denominator solution.

I did read about the colour label implementation, but i was looking forward to it as i believe it would mean that we could display xmp colour labels in PhotoLabs, too.
But i was not going to use PhotoLabs to write any tags.

Phil Harvey

Sorry, I didn't respond earlier because it wasn't clear to me what you wanted to do and I didn't have time to think about it in a lot of detail.  But it seems you you just want to set XMP:Label to "Green" if a .XMP file has a .RW2.dop counterpart.  Here is the command:

exiftool -xmp:label=Green -if "-e qq(${filepath;s/\.xmp/.RW2.dop/i})" -ext xmp DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Sandersoni

Amazing! Thank you, Phil!
That works.

In simple words, set xmp label to green for RW2 files with RW2.dop sidecars, and create xmp files and set XMP label to green if XMP doesn't exist already.

I made a few minor adjustments based on your script;
  • condition to be on the presence of RW2 (not xmp) and DOP sidecar (in step 1)
  • set label to be green, even if no XMP sidecar is present already (step 1)
  • introduced an extra condition in step 2 that will only assign tag if it is not green already, to control how many new tags were written
I failed to do this in a single step, so now I simply execute the two scripts (attached) on all files in my images folder after having worked on my files.

Step 1 - create XMPs for RAW files with dop sidecars that don't already have an XMP sidecar
exiftool -progress -o %%d%%f.xmp -ext RW2 -if "-e qq(${filepath;s/\.RW2/.RW2.dop/i})" -if "not -e qq(${filepath;s/\.RW2/.XMP/i})" .

Step 2 - assign green labels to XMPs of RAW files with .dop sidecars
exiftool -progress -XMP:label=Green -if "not $xmp:label eq 'Green'" -if "-e qq(${filepath;s/\.XMP/.RW2.dop/i})" -ext XMP -overwrite_original .

I obviously wasted two nights before realising the %%d%%f vs %d%f nuance... thankfully eventually saw it StarGeek's signature!