Posted on 2006-11-09 16:29:08-08 by binouch in response to 3180
Re: Adding additional unknown tags to existing images
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 :
%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 :
#!/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
Direct Responses: 3461 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.