ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: khargy on November 19, 2017, 12:40:55 PM

Title: Add subjects (or keywords) from one file to another
Post by: khargy on November 19, 2017, 12:40:55 PM
I can't figure out the syntax to add subjects from one file to another without overriding the ones in the destination file...

I tried this:

exiftool -addTagsFromFile "sourceFile.xmp" -xmp:subject "destFile.xmp"

and that overrides all the subjects in the destination file
Title: Re: Add subjects (or keywords) from one file to another
Post by: Phil Harvey on November 19, 2017, 12:48:32 PM
I admit this can be a bit confusing, but it is done like this:

exiftool -tagsFromFile "sourceFile.xmp" "-xmp:subject+<xmp:subject" "destFile.xmp"

The -addTagsFromFile option is to add to the new tags queued for writing, not to add to the existing tags in the file.

- Phil
Title: Re: Add subjects (or keywords) from one file to another
Post by: khargy on November 19, 2017, 04:24:20 PM
Cool that seems to work but I'm getting the following error:

Warning: Shift value for XMP-pdf:Subject is not a number - Source_File.JPG
Title: Re: Add subjects (or keywords) from one file to another
Post by: Phil Harvey on November 19, 2017, 08:02:54 PM
Right.  You can avoid this warning by further qualifying your tag:

exiftool -tagsFromFile "sourceFile.xmp" "-xmp-dc:subject+<xmp-dc:subject" "destFile.xmp"

- Phil
Title: Re: Add subjects (or keywords) from one file to another
Post by: khargy on November 19, 2017, 11:00:57 PM
Great. Thanks for the help... I've been using ExifTool for many years and I still feel like I've just barely scratched the surface :)