add CatalogSets to (structured) keywords

Started by MrSoul, March 05, 2022, 07:31:18 PM

Previous topic - Next topic

MrSoul

Hello,

I'm looking to do some heavy action on all my images stock (+50000).
Knowing that this stock is composed of JPEG with integrated meta and RAW with XMP sidecar files.

Basically I change my DAM software from Media Pro to Photo Mechanic Plus.

Only problem, I used CatalogSets a lot, obviously incompatible with my new software.

The terms in the CatalogSets field can be nested and look like this:

Catalog Sets : term|sub term

My idea would be to convert this field into a nested/structured keyword (also with lightroom compatibility).
I thought of something like this:

exiftool "-XMP-dc:Subject<XMP-mediapro:CatalogSets" "-XMP-lr:HierarchicalSubject<XMP-mediapro:CatalogSets" "-IPTC:Keywords<XMP-mediapro:CatalogSets" * -r

It works, BUT, I would like to add the field to the existing field and not replace it.

How to correct the command so as not to delete the existing keywords?

Thank you in advance.

StarGeek

Try
exiftool "-XMP:Subject+<XMP:CatalogSets" "-XMP:HierarchicalSubject+<XMP:CatalogSets" "-IPTC:Keywords+<XMP:CatalogSets" * -r

From the docs on the -TagsFromFile option
     Copied tags may also be added or deleted from a list with arguments of the form "'-SRCTAG+<DSTTAG'" or "'-SRCTAG-<DSTTAG'"
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

MrSoul

Quote from: StarGeek on March 05, 2022, 08:00:23 PM
Try
exiftool "-XMP:Subject+<XMP:CatalogSets" "-XMP:HierarchicalSubject+<XMP:CatalogSets" "-IPTC:Keywords+<XMP:CatalogSets" * -r

From the docs on the -TagsFromFile option
     Copied tags may also be added or deleted from a list with arguments of the form "'-SRCTAG+<DSTTAG'" or "'-SRCTAG-<DSTTAG'"

Thanks StarGeek, the doc is a bit dense and not very sexy, especially for someone not very comfortable with English (but that doesn't take away from the greatness of Exiftool).

Small complementary question, won't the "* -r" options cause problems with the variety of my file types?

I believe that XMP fields are not compatible with RAW files but only with JPEG and XMP sidecar files?


StarGeek

Quote from: MrSoul on March 06, 2022, 11:56:59 AM
Small complementary question, won't the "* -r" options cause problems with the variety of my file types?

I was just copy/pasting from your command for this part but the asterisk and the -r (-recurse) option are incompatible.  See that link and Common Mistake #2c.  When using -r you should use either a dot . to represent the current directory or use a full directory path.  Use the -ext (-extension) option to limit processing to specific file types.

QuoteI believe that XMP fields are not compatible with RAW files but only with JPEG and XMP sidecar files?

Exiftool can write XMP to most, if not all, RAW file types.  But a lot of photographers don't like to edit their RAW files.  And most higher end DAMs use XMP sidecar files anyway, though they will usually read XMP data in the RAW file as well.  There are pros and cons to both ways.  But if the XMP doesn't already exist in the file, then the above commands won't edit them.  In other words, exiftool will only edit the RAW files if Media Pro wrote the CatalogSets into the files in the first place.

Also, exiftool doesn't automatically make any connections between an image and an XMP sidecar file. If you write data to an image, it won't be updated in the sidecar file unless you edit the sidecar as well.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

MrSoul

So, if I use this command, it should work?


exiftool \
"-XMP:Subject+<XMP:CatalogSets" \
"-XMP:HierarchicalSubject+<XMP:CatalogSets" \
"-IPTC:Keywords+<XMP:CatalogSets" \
-ext JPG \
-ext nef \
-ext dng \
-ext xmp \
-ext TIFF \
-r \
/Volumes/Medias/Photos/



StarGeek

Looks good, but test it to see if it does what you want.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

MrSoul

The previous command gave me error messages:

Warning: Shift value for XMP-pdf:Subject is not a number - /file.XMP
Warning: Shift value for XMP-pdf:Subject is not a number - /file.jpg
Because it is in the Dublin Core (-XMP-dc:Subject) that I wanted to write.

Warning: No writable tags set from /file.nef
Because the CatalogSets field in Media Pro is not written to the RAW.

And I added the parameter :
-overwrite_original
Because my file is very heavy and cannot accommodate duplicates.

So I corrected for the following command:

exiftool \
"-XMP-dc:Subject<XMP-mediapro:CatalogSetss" \
"-XMP-lr:HierarchicalSubject<XMP-mediapro:CatalogSets" \
"-IPTC:Keywords<XMP-mediapro:CatalogSets" \
-ext JPG \
--ext nef \
-ext dng \
-ext xmp \
-ext TIFF \
-overwrite_original \
-r \
/Volumes/Medias/Photos/


PS: I duplicated the originals on another disk anyway to make sure there are no problems.

StarGeek

Quote from: MrSoul on March 07, 2022, 10:29:40 AM
The previous command gave me error messages:

Warning: Shift value for XMP-pdf:Subject is not a number - /file.XMP

This can be ignored.  It should still write to the Subject tag correctly.

QuoteWarning: No writable tags set from /file.nef
Because the CatalogSets field in Media Pro is not written to the RAW.

This can be ignored.  As I said,  if the XMP doesn't already exist in the file, then the commands won't edit them.

My advice is always to keep the tag names as simple as possible, which is why I listed just XMP: instead of the exact group locations.  It adds unneeded complexity and increase the chance of a mistake.  Especially in the case of some EXIF tags which can be written to different groups and it isn't necessarily obvious where they should go.  For example, some Sony cameras put the ModifyDate in the wrong location and if a person followed that example, they could compound the error through the rest of their workflow.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype