Thread

Posted on Thu Feb 7 11:51:01 2008 by drec
find&change in IPTC field for 1000's photos?
I am looking for simple way to change some words in IPTC Caption field. for example "kid" to "child" in a big amount of photos. Could exiftool be helpful? I use standalone Windows version of exiftool. Any advice?
Direct Responses: 7034 | Write a response
Posted on Thu Feb 7 15:41:12 2008 by exiftool in response to 7030
Re: find&change in IPTC field for 1000's photos?
To do this using the exiftool command-line interface, you will also need a helper application that does the string manipulations for you. In Unix, "sed" will do this. There is likely some Windows utility that will allow you to substitute strings on the command line, but I can't help you there.

Once you find the utility, the translations can be done like this:

exiftool -caption-abstract -b a.jpg | subst kid child - | exiftool -caption-abstract"<=-" a.jpg

Here, the "subst kid child -" command will change depending on the utility you use to do the substitution.

An alternative is to do this in Perl using the ExifTool API, which is actually very simple, but for this you need to know a bit of Perl and have the Perl interpreter installed.

- Phil
Direct Responses: 7035 | Write a response
Posted on Thu Feb 7 15:44:30 2008 by exiftool in response to 7034
Re: find&change in IPTC field for 1000's photos?
I forgot to address the point of 1000's of images, since the command like I gave only works for one. In this case, you would have to put the command in a batch file and loop through all images in a directory.

So doing this sort of thing is currently non-trivial with exiftool.

Perhaps in a future release I will add more string manipulation ability.

- Phil
Direct Responses: 7051 | Write a response
Posted on Fri Feb 8 21:42:31 2008 by exiftool in response to 7035
Re: find&change in IPTC field for 1000's photos?
Stupid me. This is easy to do with a user-defined tag:

'Image::ExifTool::Composite' => { NewCaption => { Require => 'Caption-Abstract', ValueConv => '$val =~ s/\bkid\b/child/g ? $val : undef', }, },

With this user-defined tag, just use "-caption-abstract<newCaption" to convert the caption. If the word 'kid' is not found, then the tag will not be changed. Read up on the config file documentation for help on installing the user-defined tag.

Sorry for not thinking about this earlier. You can do nearly anything with user-defined tags.

- Phil
Direct Responses: 7055 | Write a response
Posted on Sat Feb 9 00:20:31 2008 by mixx in response to 7051
Re: find&change in IPTC field for 1000's photos?
Phil,

does this work with the Windows executable version? Is this a PERL script? Do I need to learn PERL to use this capability? Where is the config file documentation (I could only find the sample config file)?

Please pardon me these questions, but I am very interested, this could help me tremendously. Currently I am using shell scripts (with all the trouble on Windows) and batch files and have to call exiftool several times for each image. With user-defined tags, it seems, one could just use one call to exiftool and get a substantial speed up.

Thanxx, Mixx

Direct Responses: 7057 | Write a response
Posted on Sat Feb 9 13:05:05 2008 by mixx in response to 7055
Re: find&change in IPTC field for 1000's photos?
OK, I took the time to test this and boy, is this COOL.

Just by defining a couple user-tags and doing some string processing on them (I could figure out the basics of PERL this much) I can now throw away my batch and shell scripts on Windows, do not need to go through the directories by "find", just do a recursive call to exiftool and that's it. I am getting an INCREDIBLE speed-up. NIIIICCCCEEEE! Folks, you should try this.

Thanks, Phil, much appreciated, Mixx

Write a response