New Custom Metadata Tags

Started by Phantomgreenie, March 21, 2011, 09:10:57 AM

Previous topic - Next topic

Phantomgreenie

As i understand it from reading posts and documentation, new tags must be created in the ExifTool config file then they can be used at the command line. But i am not a programmer and have no clue about any computer language let alone Perl. So i got lost in the example code i found on the old forum. I have been using Digikam 1.2 to put values in Metadata Tags like Owner,Contact, etc.
So for example for my photo collection about trees,scientific name tags :

Tag 1 ;   value 1,     Tag 2:    value 2,        Tag 3:     value 3

Family : Myrtacea, Genus : Eucalyptus, Species : grandis

What would the code to put  in the exiftool config file look like? :)

Phantomgreenie

Phil Harvey

The following config file adds definitions to allow you to write this information as XMP.

You should change the "myxmp" in this file to some other more meaningful namespace prefix, and change the URI from "http://ns.myname.com/myxmp/1.0/" to something more meaningful as well (note that this doesn't need to be a valid web address).

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::XMP::Main' => {
        myxmp => { # <-- must be the same as the NAMESPACE prefix
            SubDirectory => {
                TagTable => 'Image::ExifTool::UserDefined::myxmp',
                # (see the definition of this table below)
            },
        },
    },
);

# This is a basic example of the definition for a new XMP namespace.
# This table is referenced through a SubDirectory tag definition
# in the %Image::ExifTool::UserDefined definition above.
# The namespace prefix for these tags is 'myxmp', which corresponds to
# an ExifTool family 1 group name of 'XMP-myxmp'.
%Image::ExifTool::UserDefined::myxmp = (
    GROUPS        => { 0 => 'XMP', 1 => 'XMP-myxmp', 2 => 'Image' },
    NAMESPACE     => { 'myxmp' => 'http://ns.myname.com/myxmp/1.0/' },
    WRITABLE      => 'string',
    Family  => { },
    Genus   => { },
    Species => { },
);
1;  #end


I also attach this file for download since you may get some unexpected characters if you cut and paste this in some web browsers (like Safari).

- 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 ($).