First time adding new tags - help!

Started by Fotographer1986, May 18, 2023, 01:34:38 PM

Previous topic - Next topic

Fotographer1986

I want to define a new set of tags so I can copy the metadata of one file that already has these tags to another file that doesn't have them yet.

They should appear under ---- Userdata ----

Now this is what's in my config file

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::XMP::Userdata'        => {
          ColorPalette => { },
        },
);

but the program tells me it can't find the table Image::ExifTool::XMP::Userdata when I try to use the tag.


How can I accomplish what I'm trying to do?

Phil Harvey

You need to define a table with a namespace for your Userdata tags.  Something like this:

%Image::ExifTool::UserDefined::Userdata = (
    GROUPS => { 0 => 'XMP', 1 => 'XMP-Userdata', 2 => 'Image' },
    NAMESPACE => { 'Userdata' => 'http://ns.somename.com/Userdata/1.0/' },
    WRITABLE => 'string', # (default to string-type tags)
    ColorPalette => { },  # (what format do you want this to be?)
);

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::XMP::Main' => {
        Userdata => { # <-- must be the same as the NAMESPACE prefix
            SubDirectory => {
                TagTable => 'Image::ExifTool::UserDefined::Userdata',
            },
        },
    },
);

There is an example of this in the example config file.

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