keywords problems

Started by instigator, December 01, 2010, 09:26:40 AM

Previous topic - Next topic

instigator

When I use this command:
exiftool "-IPTC:keywords-=word1" "-Exif:copyright<${keywords}, word1" "-IPTC:keywords+=word1" -overwrite_original prueba.jpg
Example:
the keywords of the file named prueba.jpg was: "word1" and "word2"
with this command are:
Keywords:"word1,word2" (with keywords work OK)
Copyright: "word1,word2,word1"      (does'nt read correctly the keywords)
Any suggestion?
What I want is add a keyword(previously erase the keyword for,so the keyword don't repeat" copy the information of keywords to copyright, plus "word1", and then add "word1" to keywords.
I want do this running the program only one time

Phil Harvey

When copying tags, the source tag value is always the value as extracted directly from the file.

The best way to modify a value before it is copied to another tag is to create a user-defined tag.  There are many examples of how to do this in this forum.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

instigator

Quote from: Phil Harvey on December 01, 2010, 11:21:22 AM
When copying tags, the source tag value is always the value as extracted directly from the file.

The best way to modify a value before it is copied to another tag is to create a user-defined tag.  There are many examples of how to do this in this forum.

- Phil


I don't know how to create a user-defined for this. Can Help me please?

Phil Harvey

It is true that the value conversion for list-type tags is a bit trickier.  The following conversion will remove the keyword "word1" (case insensitive) from the list:

    ValueConv => q{
        my @list = ref $val eq 'ARRAY' ? @$val : ($val);
        @list = grep !/^word1$/, @list;
        return join ', ', @list;
    },


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

instigator

sorry for my ignorance, really I don't know what are you talking about.
So i really appreciate if you tell me how can be the entire function, and where I put this:
ValueConv => q{
        my @list = ref $val eq 'ARRAY' ? @$val : ($val);
        @list = grep !/^word1$/, @list;
        return join ', ', @list;
    },

in other words, how can be the entre function if I run exiftool from cmd?

Phil Harvey

The config file documentation describes how to create user-defined tags.  Basically, you need to create a config file with a user-defined Composite tag and the above ValueConv conversion.  This forum contains lots of examples to help you (see the search link in my previous post).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).