ExifTool Forum

ExifTool => Archives => Topic started by: Archive on May 12, 2010, 08:53:57 AM

Title: Add new XMP group?
Post by: Archive on May 12, 2010, 08:53:57 AM
[Originally posted by airmoi on 2006-10-30 20:55:06-08]

Hi there!
I'm trying to set values in a special XMP group but It told me key doesn't exist or isn't writable.
I can see keys I want to modify using imageInfo() but I think exiftool just doesn't support that XMP group. Its a special group created by Ressouces service at my work. Is there a way to add its support into exiftool? I found some code in image::exiftool::xmp as well as in writexmp. Tryed to add my group  in but it still doesn't works.
Title: Re: Add new XMP group?
Post by: Archive on May 12, 2010, 08:53:57 AM
[Originally posted by exiftool on 2006-10-31 20:33:55-08]

Yes.  The
ExifTool_config
file included with the distribution shows you to add write support for
custom XMP groups.

- Phil
Title: Re: Add new XMP group?
Post by: Archive on May 12, 2010, 08:53:57 AM
[Originally posted by binouch on 2006-11-09 16:33:00-08]

Hello,

I just discovered this new module and the concept of what it could do is fantastic. I'm trying to put it into "production" in my environment but i'm running into some difficulties. I would like to add custom tags to files. Here is what i've done so far but infortunately i get the "Tag 'CustomerName' does not exist" error.
I built a .ExifTool_config file that i put in both the EXIFTOOL_HOME directory and the dir in which i am running the script from (just to make sure - this is running on linux).
Here is the content of the .ExifTool_config file :
Code:
%Image::ExifTool::UserDefined::myCompany = (
    GROUPS => { 0 => 'XMP', 1 => 'XMP-xxx', 2 => 'Image' },
    NAMESPACE => { 'myCompany' => 'http://ns.myname.com/xxx/1.0/' },
    WRITABLE => 'string',
    # replace "NewXMPxxxTag1" with your own tag name (ie. "MyTag")
    CustomerName => { },
    NewXMPxxxTag2 => { Groups => { 2 => 'Author' } },
    NewXMPxxxTag3 => { List => 'Bag' },
);

# The %Image::ExifTool::UserDefined hash defines new tags to be
# added to existing tables.
%Image::ExifTool::UserDefined = (

    # new XMP namespaces (ie. XMP-xxx) must be added to the Main XMP table:
    'Image::ExifTool::XMP::Main' => {
        myCompany => {
            SubDirectory => {
                TagTable => 'Image::ExifTool::UserDefined::myCompany',
            },
        },
    },
);
And the script i'm running to write a new value to that tag on a file is the following :

Code:
#!/usr/bin/perl

        use Image::ExifTool;
        my $exifTool = new Image::ExifTool;
        $exifTool->SetNewValue(CustomerName => "Bla Inc");
        $exifTool->WriteInfo('/raid1/Jobs/newCompany/Jacobs_018.tif');

Any kind of help would be appreciated - I'd really like to get this module working.

Thank you in advance.

Ben