ExifTool Forum

ExifTool => Newbies => Topic started by: arielmt on June 08, 2018, 06:58:09 PM

Title: Copying EXIF data -> ITPC data
Post by: arielmt on June 08, 2018, 06:58:09 PM
Hi.

First, greetings from Buffalo, NY and thank you for providing this resource - both ExifTool itself and these forums (for newbies like me)!

I'm in the (un)enviable position of needing to move 10 years worth of images (roughly 28k files comprising 200GB) from one digital asset management system repository to another. I won't even go into the horrors of what it took to retrieve our assets from the former vendor. However, before re-uploading our images to their new home, I've been working to do some serious cleanup of the embedded data, mostly the keywords, copyright data and photographer name. Along the way, I've found and tried about a half-dozen tools to accomplish these tasks. Mostly, programs like XnView and AttributeMagic Pro have handled the batch editing I've needed to do.

I've spent a ton of time correcting and standardizing EXIF keyword data so that our users will have an easier time finding images in the new repository. I've also worked to standardize and clarify EXIF copyright and artist data. After getting through the first group of images (about 1/6th of the total) I uploaded them to our new DAM system to see how things would work out. Imagine my surprise to find the keywords and copyright data unchanged when browsing the images as a regular user. After all that work! It was then I learned that our new system is presenting the ITPC data on the front and and not the EXIF data.

I now find myself needing to copy the contents of specific EXIF fields into corresponding ITPC fields for all of the files I have corrected and those I have yet to do. Specifically, I need to make these transfers at a minimum:

EXIF Copyright -> ITPC Copyright
EXIF Artist -> ITPC Byline (or Author or some similar field)
EXIF Keywords -> ITPC Keywords

While it's possible that one of the tools I've been using could do it, I've not found a way to batch process it. After lots of time with Google, I've ended up here.

I'm not afraid of running a command line tool but yours has many, many options and this newbie is already weeks past the due date. So, I'm looking for a push in the right direction!

Thanks for any help and advice you can give.

Regards,
April
Title: Re: Copying EXIF data -> ITPC data
Post by: StarGeek on June 08, 2018, 10:16:46 PM
I'm assuming that by Keywords, your files are using the XPKeywords tag, as there is no actual "Keywords" tag in EXIF.  If that's the case, then the following command would work:
exiftool "-IPTC:By-line<EXIF:Artist" "-IPTC:CopyrightNotice<EXIF:Copyright" -sep ";" "-IPTC:Keywords<EXIF:XPKeywords" FileOrDir

If there is other data you wish to copy (time stamps, Description) you can instead use the Exif2IPTC.args file.  Click here (https://sourceforge.net/p/exiftool/code/ci/master/tree/arg_files/exif2iptc.args) and then click "Download this file".  Save it into the same directory as exiftool.  You can then use this command (it takes care of Artist and Copyright as well as other items):
exiftool -@ exif2iptc.args -sep ";" "-IPTC:Keywords<EXIF:XPKeywords" FileOrDir

Replace FileOrDir with the files and/or directories you wish to process.  This command creates backup files.  Add -overwrite_original to suppress the creation of backup files.  Add -r to recurse into subdirectories.  If this command is run under Unix/Mac, reverse any double/single quotes to avoid bash interpretation.

Edit: No space after the semicolon in the -sep option.
Title: Re: Copying EXIF data -> ITPC data
Post by: arielmt on June 13, 2018, 04:58:41 PM
Hi and thanks for the reply! I'm just now getting back to this and have some follow-up questions...

1. I've tried the command you gave but am wondering whether folder location and/or naming could be a problem? For example, a file path is J:\WebDAM Assets\Athletics & Sports\2017-09 Women's Volleyball and I receive the error "The system cannot find the path specified." In this case, it's on an external drive.

2. The link in your reply to the Exif2IPTC.args file doesn't work. There's no file to download at that address. Do you have another location?

Thanks,
April

Title: Re: Copying EXIF data -> ITPC data
Post by: arielmt on June 13, 2018, 05:16:44 PM
More info:

I initially tried running the command from C:\Users\arielmt\> but then I changed to the actual path (renamed to get rid of the & and ' in the path) and ran the command. This worked but gave these results:

J:\WebDAM Assets\Athletics Sports\2017-09 Womens Volleyball>exiftool "-IPTC:By-l ine<EXIF:Artist" "-IPTC:CopyrightNotice<EXIF:Copyright" -sep "; " "-IPTC:Keywords<EXIF:XPKeywords" *.jpg

Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_009.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_016.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_021.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_024.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_025.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_033.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_035.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_054.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_055.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_066.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_067.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_078.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_115.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_116.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_122.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_124.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_128.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_129.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_130.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_144.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_146.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_152.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball 2017_155.jpg
Warning: [Minor] IPTC:Keywords exceeds length limit (truncated) - DYC Womens Volleyball Team 2017_002.jpg

   24 image files updated


It looks like the max length for IPTC:Keywords is 65 characters using ExifTool? I'm able to manually copy the keywords to the field using XnView. How do we get it to copy the keyword terms in their entirety?

So, I uploaded this batch to the repository we're using and it seems that all the keywords were copied to the IPTC:Keywords field despite the warning. I'm happy but now a bit mystified by the warning message. As long as all keywords are fully copied and I can do multiple folders at a time with -r then I should be all set. Though, I would like to investigate using the Exif2IPTC.args file, as some images in my batches may have description and other fields completed.
Title: Re: Copying EXIF data -> ITPC data
Post by: StarGeek on June 13, 2018, 07:25:56 PM
Quote from: arielmt on June 13, 2018, 04:58:41 PM
1. I've tried the command you gave but am wondering whether folder location and/or naming could be a problem? For example, a file path is J:\WebDAM Assets\Athletics & Sports\2017-09 Women's Volleyball and I receive the error "The system cannot find the path specified." In this case, it's on an external drive.

Did you enclose the file path in quotes?  You have both spaces and an ampersand in that file path.  The command line uses spaces to separate different options in the command and windows uses the ampersand to run two separate commands in sequence.  If you enclose your file path in quotes like this "J:\WebDAM Assets\Athletics & Sports\2017-09 Women's Volleyball", it will be taken as a single option in the command line, not multiple options and a multiple command split.

Quote2. The link in your reply to the Exif2IPTC.args file doesn't work. There's no file to download at that address. Do you have another location?

It's there.  Click the link and then click "Download this file"
(https://i.imgur.com/SHWUWz5.png)



Quote from: arielmt on June 13, 2018, 05:16:44 PM
J:\WebDAM Assets\Athletics Sports\2017-09 Womens Volleyball>exiftool "-IPTC:By-l ine<EXIF:Artist" "-IPTC:CopyrightNotice<EXIF:Copyright" -sep "; " "-IPTC:Keywords<EXIF:XPKeywords" *.jpg

So, I uploaded this batch to the repository we're using and it seems that all the keywords were copied to the IPTC:Keywords field despite the warning. I'm happy but now a bit mystified by the warning message. As long as all keywords are fully copied and I can do multiple folders at a time with -r then I should be all set. Though, I would like to investigate using the Exif2IPTC.args file, as some images in my batches may have description and other fields completed.

Sorry, my mistake.  It needs to be -sep ";" without the trailing space. 

While it may look like it worked, what actually happened was that it created a single very long keyword containing all the keywords.  For example, if you had three keywords, Keyword1, Keyword2, and Keyword3, what happened was that a single keyword consisting of
Keyword1, Keyword2, Keyword3
was created instead of three keywords
Keyword1
Keyword2
Keyword3


If you go into your repository and try to look at single keywords (not sure how your repository works), it should become clear.

QuoteThough, I would like to investigate using the Exif2IPTC.args file, as some images in my batches may have description and other fields completed.

If the other fields are prefixed by XP, then it will take something else, as the XP tags (XPAuthor, XPComment, XPKeywords, XPSubject, XPTitle) are pretty much Windows specific and won't be copied by the Exif2IPTC.args file.
Title: Re: Copying EXIF data -> ITPC data
Post by: arielmt on June 20, 2018, 04:02:48 PM
Hello again. Thanks for the updates. I'm still working on this and have successfully downloaded the exif2iptc.args file but I'm probably still doing something wrong because when I try the command below the files are not processed.

C:\Program Files (x86)\EXIF Tool>exiftool -@ exif2iptc.args -sep ";" "-IPTC:Keywords<EXIF:XPKeywords" "J:\WebDAM Assets\Athletics Sports\2014-12 Tennis West Buffalo Charter School\"

I get this:
1 directories scanned
0 image files read

When I add *.jpg as I did when I successfully ran the command previously, I simply get "No matching files" returned.

It only works when I change directories to use the actual image directory in the command prompt and specify *.jpg.
Title: Re: Copying EXIF data -> ITPC data
Post by: StarGeek on June 20, 2018, 05:33:50 PM
Try removing the trailing backslash from the directory path
"J:\WebDAM Assets\Athletics Sports\2014-12 Tennis West Buffalo Charter School"

I believe that the last backslash is escaping the final double quote as per this StackOverflow answer (https://stackoverflow.com/a/41607359/3525475).
Title: Re: Copying EXIF data -> ITPC data
Post by: arielmt on June 24, 2018, 12:58:28 AM
Thanks, that worked! I have 2 more questions...

I am copying EXIF XP Keywords to the IPTC Keywords field with

exiftool -@ exif2iptc.args -sep ";" "-IPTC:Keywords<EXIF:XPKeywords" "DirectoryPath" -r -overwrite_original

However, as in the output example I posted previously, I'm getting "Warning: [Minor] IPTC:Keywords exceeds length limit (truncated)" for quite a few of my files because they have multiple keyword phrases that end up quite long. The IPTC Keywords field is only receiving the first 65 characters. This isn't a limitation of the IPTC Keyword field because when I upload these files to my repository, I can add keywords well beyond 65 characters. While my repository shows both sets of keywords in the admin interface, it's the IPTC set of keywords that are used in the user interface for searching and filtering.

Importing images with truncated keywords pretty much defeats the purpose of what I'm trying to do. Is there any way around the 65 character limit?

I'm also getting an error that says "Unknown file type - exif2iptc.args" even though the other data like copyright and artist seem to be correctly copied to their corresponding IPTC fields. Do I need to be concerned with this?

Thanks for the help!
Title: Re: Copying EXIF data -> ITPC data
Post by: StarGeek on June 24, 2018, 01:57:16 AM
Quote from: arielmt on June 24, 2018, 12:58:28 AM
However, as in the output example I posted previously, I'm getting "Warning: [Minor] IPTC:Keywords exceeds length limit (truncated)" for quite a few of my files because they have multiple keyword phrases that end up quite long.

Ah, I didn't know that your keywords were so long.

Short answer, add -m to the command to override minor warnings.

(Slightly) Long(er) answer, according to the specs, there is a character limit for IPTC Keywords.  The -m option will override this limit and many programs also ignore this limit.

QuoteI'm also getting an error that says "Unknown file type - exif2iptc.args" even though the other data like copyright and artist seem to be correctly copied to their corresponding IPTC fields. Do I need to be concerned with this?

This I'm not sure about.  I can't reproduce it when I copy/paste your command.  For some reason exiftool is being told that the exif2iptc.args file is a file to be processed.  Is the exif2iptc.args file in the directory that's being processed?  Though that shouldn't be processed anyway due to the extension.
Title: Re: Copying EXIF data -> ITPC data
Post by: Phil Harvey on June 24, 2018, 07:18:03 AM
Quote from: arielmt on June 24, 2018, 12:58:28 AM
I'm also getting an error that says "Unknown file type - exif2iptc.args"

Is somehow "exif2iptc.args" one of the lines inside exif2iptc.args?  If so, remove it or add a "#" at the start to comment it out.

- Phil
Title: Re: Copying EXIF data -> ITPC data
Post by: arielmt on June 24, 2018, 03:06:05 PM
Quote from: StarGeek on June 24, 2018, 01:57:16 AM
Ah, I didn't know that your keywords were so long.

Short answer, add -m to the command to override minor warnings.

(Slightly) Long(er) answer, according to the specs, there is a character limit for IPTC Keywords.  The -m option will override this limit and many programs also ignore this limit.

Awesome! This worked, thank you.
Title: Re: Copying EXIF data -> ITPC data
Post by: arielmt on June 24, 2018, 03:30:30 PM
Quote from: Phil Harvey on June 24, 2018, 07:18:03 AM

Is somehow "exif2iptc.args" one of the lines inside exif2iptc.args?  If so, remove it or add a "#" at the start to comment it out.

- Phil

No. I have checked the exif2iptc.args file in a text editor and the file name itself is not an entry in the file except in the already commented out section in the first 19 lines of the file. I last ran:

C:\Program Files (x86)\EXIF Tool>exiftool -@ exif2iptc.args -sep ";" "-IPTC:Keywords<EXIF:XPKeywords" "J:\WebDAM Assets\Full Regalia Ceremonies" *.* -r -m -overwrite_original

and got this result:

Error: Unknown file type - exif2iptc.args
Warning: No writable tags set from exiftool(-k).exe
   27 directories scanned
4063 image files updated
    1 image files unchanged
    1 files weren't updated due to errors


The exif2iptc.args file is located in C:\Program Files (x86)\EXIF Tool.

Before running ExifTool, I am using other software programs to clean up XPKeywords, add copyright dates, and delete the XMP data. (EXIF and IPTC are enough for me to deal with and much of the XMP is stuff added by Adobe programs that we have used to batch process in the past.) The XMP keyword set is what's shown in Windows Explorer tags field and it's really annoying to keep seeing the bad keywords when I know I've corrected them in the EXIF and IPTC fields. Once XMP data is gone, Windows displays both the EXIF and IPTC keywords in the Tags field in Explorer. This is helpful as a quick reference for me to know whether or not I've made needed corrections.
Title: Re: Copying EXIF data -> ITPC data
Post by: StarGeek on June 24, 2018, 06:29:16 PM
Quote from: arielmt on June 24, 2018, 03:30:30 PM
C:\Program Files (x86)\EXIF Tool>exiftool -@ exif2iptc.args -sep ";" "-IPTC:Keywords<EXIF:XPKeywords" "J:\WebDAM Assets\Full Regalia Ceremonies" *.* -r -m -overwrite_original

Ah, there's the problem.  You don't need the *.*.  What's happening when you add that is that exiftool is also processing all the files in the local directory, C:\Program Files (x86)\EXIF Tool as well as the files in J:\WebDAM Assets\Full Regalia Ceremonies.  Anytime you need to process only specific extensions with exiftool, use the -ext option (https://exiftool.org/exiftool_pod.html#ext-EXT---ext-EXT--extension), especially when using the recurse option, as wild cards won't work with recursion.

QuoteBefore running ExifTool, I am using other software programs to clean up XPKeywords, add copyright dates, and delete the XMP data.

One thing to make clear, XPKeywords is not XMP data.  It is Microsoft's own keyword tag that is actually stored in the EXIF block.  It is pretty much ignored by most programs.

QuoteThe XMP keyword set is what's shown in Windows Explorer tags field

Windows will actually show you the combined contents of XPKeywords, IPTC:Keywords, and XMP:Subject.  Take a look at the Windows Metadata (https://exiftool.org/forum/index.php/topic,6591.msg32875.html#msg32875) post for what tags Windows will read and write.
Title: Re: Copying EXIF data -> ITPC data
Post by: Phil Harvey on June 24, 2018, 08:21:55 PM
Quote from: StarGeek on June 24, 2018, 06:29:16 PM
Ah, there's the problem.  You don't need the *.*.

Yup.  Good catch.

- Phil