|
Hi Phil,
I am still trying to create a custom tag in the GPS group and write content to it.
The following does not work yet:
me@me-u904:~$ perl /home/me/scripts/custom_tag.pl
Sorry, MyNewTag is not writable
May I ask for your help?
Thanks,
Jan
#!/usr/bin/perl
use warnings;
# Most of this file copied from:
# http://cpanforum.com/threads/7404#7424
# ============================== Load modules ====================================
use Image::ExifTool qw(:Public);
my ($picFile);
$picFile = '/home/me/image_001.jpg';
$tagvalue = <<END;
Jipeee, it works!
END
# print $tagvalue;
#define ExifTool object;
my $ExifTool = new Image::ExifTool;
# adapted from http://owl.phy.queensu.ca/~phil/exiftool/config.html
%Image::ExifTool::UserDefined = (
'Image::ExifTool::Exif::Main' => { 0xd000 => { Name => 'MyNewTag', Writable => 'int16u', WriteGroup
+ => 'GPS', }, } );
$ExifTool->SetNewValue('MyNewTag', $tagvalue);
$ExifTool->WriteInfo($picFile);
print "After mod=============================================== \n";
my $info = ImageInfo($picFile);
foreach (keys %$info) { print "$_ => $$info{$_}\n";
} #end
|