ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Sandersoni on January 16, 2022, 05:45:35 PM

Title: Transfer meta data from proprietary third party RAW side car (dop) into xmp
Post by: Sandersoni on January 16, 2022, 05:45:35 PM
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:

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:

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).
Title: Re: Transfer meta data from proprietary third party RAW side car (dop) into xmp
Post by: StarGeek on January 16, 2022, 05:54:01 PM
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.
Title: Re: Transfer meta data from proprietary third party RAW side car (dop) into xmp
Post by: Sandersoni on January 16, 2022, 06:00:16 PM
Oh, bummer! Thank you for your response!
Another option would be create an xmp tag if a .dop sidecard is present.
Title: Re: Transfer meta data from proprietary third party RAW side car (dop) into xmp
Post by: Phil Harvey on January 16, 2022, 09:11:14 PM
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
Title: Re: Transfer meta data from proprietary third party RAW side car (dop) into xmp
Post by: Sandersoni on January 17, 2022, 05:07:09 PM
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).
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.
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.
Title: Re: Transfer meta data from proprietary third party RAW side car (dop) into xmp
Post by: Sandersoni on January 25, 2022, 01:25:22 PM
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.
Title: Re: Transfer meta data from proprietary third party RAW side car (dop) into xmp
Post by: Joanna Carter on January 27, 2022, 02:25:15 AM
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.
Title: Re: Transfer meta data from proprietary third party RAW side car (dop) into xmp
Post by: Sandersoni on January 27, 2022, 09:17:12 AM
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.
Title: Re: Transfer meta data from proprietary third party RAW side car (dop) into xmp
Post by: Phil Harvey on January 27, 2022, 02:15:37 PM
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
Title: Re: Transfer meta data from proprietary third party RAW side car (dop) into xmp
Post by: Sandersoni on February 06, 2022, 06:02:17 PM
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;
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!