Script to write text file content to exif as keywords

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

Previous topic - Next topic

Archive

[Originally posted by towsonu2003 on 2007-05-07 20:07:49-07]

Hi,

I was using GQView and adding keywords. The minute I was done adding
keywords 3000+ images, I learned that the program doesn't write to exif
or anything, it write the information to a separate file. Oops Smiley

Now, I would like to transfer the contents of the file into the exif of
each image I have, without risking to lose the image of course. I'm
using linux.

here is how a directory looks:

.metadata (directory)

Image.jpg (picture)

here is how the .metadata directory looks like:

Image.jpg.meta (text file)

here is how the Image.jpg.meta textfile looks like:

#GQview comment (2.0.1)

[keywords]

image

keyword1

keyword2

[comment]

#end

Now, I need to write the words under [keyword] into the exif of the
Image.jpg. Is there a way to this with some script? If so, can you help
me with that script. thanks Smiley

Archive

[Originally posted by exiftool on 2007-05-07 21:53:44-07]

This isn't a very difficult script to write if you know a bit of Perl.
But I'm assuming you don't since you're asking for some help.
It will probably be quicker for me to write it myself than to tell
you how to do it, but I don't have time right at the moment.
I'll post a script when I get a chance.  Probably tomorrow.

Here is an
example
of a script that does something similar, but the
details in your case are just different enough that it will require
some Perl knowledge to change it to work for you.

- Phil

Archive

[Originally posted by linuxuser on 2007-05-08 08:38:06-07]

You didn't tell which script you like to use. I discussed this not so long ago for the bash. I write the keywords in a text-file, each line a key (can contain more words) and then import this file to the keywords with
Code:
exiftool -q -q -overwrite_original -@ "$KEYWORDARGSTXT" "$Image"
. The advantage is, that you can create the keys (textfile) as it is possible, by script or manually.

Archive

[Originally posted by linuxuser on 2007-05-08 14:23:29-07]

I forget to mention, that every line has to start with the tag-name, in this case, e.g: -IPTC:keywords=examplekey