Thread

Posted on Mon May 7 23:07:49 2007 by towsonu2003
Script to write text file content to exif as keywords
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 :)

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 :)
Direct Responses: 5074 | 5078 | Write a response
Posted on Tue May 8 00:53:44 2007 by exiftool in response to 5071
Re: Script to write text file content to exif as keywords
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
Write a response
Posted on Tue May 8 11:38:06 2007 by linuxuser in response to 5071
Re: Script to write text file content to exif as keywords
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
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.
Direct Responses: 5085 | Write a response
Posted on Tue May 8 17:23:29 2007 by linuxuser in response to 5078
Re: Script to write text file content to exif as keywords
I forget to mention, that every line has to start with the tag-name, in this case, e.g: -IPTC:keywords=examplekey
Write a response