find&change in IPTC field for 1000's photos?

Started by Archive, May 12, 2010, 08:54:15 AM

Previous topic - Next topic

Archive

[Originally posted by drec on 2008-02-07 09:51:01-08]

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?

Archive

[Originally posted by exiftool on 2008-02-07 13:41:12-08]

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:

Code:
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

Archive

[Originally posted by exiftool on 2008-02-07 13:44:30-08]

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

Archive

[Originally posted by exiftool on 2008-02-08 19:42:31-08]

Stupid me.  This is easy to do with a user-defined tag:

Code:
'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

Archive

[Originally posted by mixx on 2008-02-08 22:20:31-08]

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

Archive

[Originally posted by mixx on 2008-02-09 11:05:05-08]

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