I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2007-04-16 20:40:27-07 by linuxuser
Multiple keywords
i refer to the example at the homepage:

exiftool -keywords=EXIF -keywords=editor dst.jpg Replace existing keyword list with two new keywords (EXIF and editor).


What do I need the hold keywords together, e.g.: _"Phil's Exif" Tool_ and not _Exif Phil's Tool_. I doesn't work with

-IPTC:Keywords="Phil's Exif" -IPTC:Keywords="Tool"
Direct Responses: 4901 | Write a response
Posted on 2007-04-16 23:20:24-07 by exiftool in response to 4898
Re: Multiple keywords
Sorry, I don't get it again.

What you posted will work, and enter 2 new keywords:

1) "Phil's Exif"

2) "Tool"

When you extract them, keywords are separated by a comma, so the output will look like:

"Phil's Exif, Tool"

Isn't that what you wanted?

- Phil
Direct Responses: 4902 | Write a response
Posted on 2007-04-17 00:03:16-07 by linuxuser in response to 4901
Re: Multiple keywords
Sorry Phil, I didnt realize that there is a difference between EXIF and IPTC, when I posted the example. There is another example

exiftool -EXIF:XPKeywords="Phil's Exif" -EXIF:XPKeywords="Tool" -IPTC:Keywords="Phil's Exif" -IPTC: +Keywords="Tool" test.jpg exiftool -G -H -EXIF:XPKeywords -IPTC:Keywords test.jpg [EXIF] 0x9c9e XP Keywords : Tool [IPTC] 0x0019 Keywords : Phil's Exif, Tool


The example is from a commandline now. XPKeywords always stores the last keyword with my syntax. Maybe I have a quoting problem with my bash-script too. I will check it, after I know, what I did wrong with the XP Keywords. I would also like to mention, that I would like to import the keywords as tags to flickr. Is another syntax possible to create multiple keywords? I create a keyword list with sed and can put any delimiter in the text string. It doesn't work with flickr to write all keywords like

exiftool -EXIF:XPKeywords="Phil's Exif,Tool" -IPTC:Keywords="Phil's Exif,Tool" test.jpg


I tried also other variations as delimiter like a blank. It is ok with flickr only if I use -IPTC:Keywords=... -IPTC:Keywords=... The command is stored in a variable of the bash-script and I execute it without quotes, eg. exiftool $CMD (and not "$CMD"), where CMD="-IPTC:Keywords=... -IPTC:Keywords=..."
Direct Responses: 4907 | Write a response
Posted on 2007-04-17 11:35:21-07 by exiftool in response to 4902
Re: Multiple keywords
Ah. This is the difference between a normal tag and a "list" tag. In the tag name documentation, the "list" tags are indicated by a '+' sign in the Writable column. Multiple copies of these tags can be written, and when extracting they are combined into a single comma-separated list for convenience. The XPComment tag is not one of these tags, so you must write the exact string you want returned. ie)

exiftool -xpkeywords="Phil's Exif, Tool" -keywords="Phil's Exif" -keywords="Tool" test.jpg

- Phil
Direct Responses: 6735 | Write a response
Posted on 2007-12-20 22:28:14-08 by adrianb in response to 4907
Re: Multiple keywords

Hi. I have a problem which I think is related to this. I am trying to copy across my IPTC tags to Windows XP tags, so that I can search for photos in Windows by tags. At the moment I am using the following:

exiftool -ObjectName>XPTitle -Caption-Abstract>XPSubject -Keywords>XPKeywords test.jpg

All is working well apart from the keywords - only the first word on the list is copied across. I am guessing this is because IPTC Keywords is a list tag and XP Keywords is a normal text tag. Is there any way to convert from one to the other?

Thanks,

Adrian
Direct Responses: 6736 | Write a response
Posted on 2007-12-20 23:25:41-08 by exiftool in response to 6735
Re: Multiple keywords
Hi Adrian,

I have anticipated your question, and ExifTool 7.07 (released a couple of days ago) will allow you to do what you want. With this version, list-type tags are concatinated in a comma-delimited list when copied to a non-list tag.

(you've gotta admit... sometimes I'm good)

- Phil
Direct Responses: 6737 | Write a response
Posted on 2007-12-21 00:08:52-08 by adrianb in response to 6736
Re: Multiple keywords

Wow, that was pretty impressive. Hooray for concatenation.

That was obviously just too easy, so here's another one. Now I'd like to be able to take the IPTC location tags (City, Sub-location, etc.) and add them to my shiny new XP Keywords. My first step was to try:

exiftool -City+>XPKeywords

but this didn't work because XP Keywords is not a list. Is there a way to append text to normal tags like this? I suppose I could first add them to IPTC Keywords and then copy the whole lot across, but that doesn't seem like the most efficient approach.

Direct Responses: 6738 | Write a response
Posted on 2007-12-21 00:33:28-08 by exiftool in response to 6737
Re: Multiple keywords
This is too easy as well, you're going to have to do better... ;)

The -tagsFromFile option (which you are using implicitly when copying tags) supports copying from a string in which you can embed tags, like this:

exiftool "-xpkeywords<$xpkeywords, $city" FILE

Note that you must use single quotes in Unix shells, or double quotes as above in Windows. Read the -TagsFromFile section in the application documentation for more details.

- Phil
Direct Responses: 6742 | 11283 | Write a response
Posted on 2007-12-21 16:27:12-08 by linuxuser in response to 6738
Re: Multiple keywords
Was there a change from 7.06 to 7.07? Tags are not imported to Flickr anymore, when I use 7.07, but it works with 7.06. With 7.07 Flickr imports all tags as 1 tag. I import the tags from a file.
Direct Responses: 6743 | Write a response
Posted on 2007-12-21 17:22:11-08 by exiftool in response to 6742
Re: Multiple keywords
Yes, there was a change in the way tags are copied if the source tag is a list. I have just looked into this and there is a bug in the new code. I will fix this and release 7.08 shortly. Thanks for pointing this out.

- Phil
Direct Responses: Write a response
Posted on 2009-08-12 13:20:14-07 by adrianb in response to 6738
Re: Multiple keywords

Hi Phil. Apologies for resurrecting an old thread, but this follows on directly from what I was trying to achieve a while back. Thanks to your very helpful answer from last time I have been using the following string to copy tags into XPKeywords:

exiftool -"XPKeywords<$Keywords, $Sub-location, $City, $Province-State, $Country-PrimaryLocationName" - FILE

However if just one of the tags is missing (e.g. City), then none of them are copied across to XPKeywords, and I get this message:

Warning: [minor] Tag 'City' not defined - FILE

I would like to be able to have the same string that I can use for batch processing different photos which may not always have all of the tags - is there a way of doing this?

Many thanks, Adrian
Direct Responses: 11284 | Write a response
Posted on 2009-08-12 13:28:20-07 by exiftool in response to 11283
Re: Multiple keywords
Hi Adrian,

There are 2 ways to do this. From the exiftool documentation:

If a tag does not exist, the output value is set to '-' if the -f option is used. Otherwise a minor warning is issued and the line with the missing tag is not printed. However, if the -m option is used, minor warnings are ignored and the line is printed with an empty tag value.

- Phil
Direct Responses: Write a response