Main Menu

Multiple keywords

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

Previous topic - Next topic

Archive

[Originally posted by linuxuser on 2007-04-16 20:40:27-07]

i refer to the example at the homepage:

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

Code:
-IPTC:Keywords="Phil's Exif" -IPTC:Keywords="Tool"

Archive

[Originally posted by exiftool on 2007-04-16 23:20:24-07]

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

Archive

[Originally posted by linuxuser on 2007-04-17 00:03:16-07]

Sorry Phil, I didnt realize that there is a difference between EXIF and IPTC, when I posted the example. There is another example

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

Code:
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=..."

Archive

[Originally posted by exiftool on 2007-04-17 11:35:21-07]

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)

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

- Phil

Archive

[Originally posted by adrianb on 2007-12-20 22:28:14-08]

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

Archive

[Originally posted by exiftool on 2007-12-20 23:25:41-08]

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

Archive

[Originally posted by adrianb on 2007-12-21 00:08:52-08]

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.

Archive

[Originally posted by exiftool on 2007-12-21 00:33:28-08]

This is too easy as well, you're going to have to do better... Wink

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

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

Archive

[Originally posted by linuxuser on 2007-12-21 16:27:12-08]

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.

Archive

[Originally posted by exiftool on 2007-12-21 17:22:11-08]

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

Archive

[Originally posted by adrianb on 2009-08-12 13:20:14-07]

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&lt$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

Archive

[Originally posted by exiftool on 2009-08-12 13:28:20-07]

Hi Adrian,

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

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