ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: sam.hepworth on July 27, 2011, 09:57:09 AM

Title: Problem with custom XMP tag
Post by: sam.hepworth on July 27, 2011, 09:57:09 AM
Hi,

I have created config file with two XMP custom tags. It looks like this:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::XMP::xmp' => {
        CameraDate => { Groups => { 2 => 'Author' } },
    },
    'Image::ExifTool::XMP::xmp' => {
        Identifier => { Groups => { 2 => 'Author' } },
    }
);
1;

The  Identifier tag works, but there is a problem with the CameraDate tag. This commandline:
exiftool.exe -config ExifTool.cfg 20101031-IX870-22.50.27.jpg -CameraDate=Test -Identifier=Test

Output:
Warning: Tag 'CameraDate' does not exist
    1 image files updated

I do not understand why a tag called CameraDate does not work but a tag called Identifier does. Maybe there is a small bug in ExifTool?

/Sam
Title: Re: Problem with custom XMP tag
Post by: Phil Harvey on July 27, 2011, 10:04:06 AM
Hi Sam,

Your 2nd definition is overriding the first.  Try this:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::XMP::xmp' => {
        CameraDate => { Groups => { 2 => 'Time' } },
        Identifier => { },
    }
);


Also, I have changed the family 2 groups to something more reasonable.

- Phil
Title: Re: Problem with custom XMP tag
Post by: sam.hepworth on July 28, 2011, 03:19:05 AM
Hi Phil,

Thanks! It works :) I wonder what the meaning of " Groups => { 2 => 'Time' }"  is?

/Sam

Quote from: Phil Harvey on July 27, 2011, 10:04:06 AM
Hi Sam,

Your 2nd definition is overriding the first.  Try this:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::XMP::xmp' => {
        CameraDate => { Groups => { 2 => 'Time' } },
        Identifier => { },
    }
);


Also, I have changed the family 2 groups to something more reasonable.

- Phil
Title: Re: Problem with custom XMP tag
Post by: Phil Harvey on July 28, 2011, 07:00:26 AM
This sets the family 2 group name for the tag.  These group names are only used to group tags into categories for use with the -g2 option.

- Phil
Title: Re: Problem with custom XMP tag
Post by: sam.hepworth on July 29, 2011, 04:35:32 AM
Ok, thanks.

-Sam