In the code below, I get the error:
Can't call method "SetNewValue" on unblessed
reference at /Users/greg/bin/rawtest.pl line 13.
Any help is appreciated!
Greg
----<code>
#!/usr/bin/perl -w
use Image::ExifTool 'ImageInfo';
#use IO::File;
#use Time::Local;
$photodirectory =
"/Volumes/d\$/PhotoMaster/rawtest/";
opendir(DIRHANDLE, "$photodirectory") || die
"Cannot opendir $photodirectory: $!";
foreach $file (sort readdir(DIRHANDLE)) {
my $info = ImageInfo($photodirectory.$file);
if (($file =~ /4892test.cr2/)|($file =~ /4892test.CR2/)) {
$info->SetNewValue("Caption", "Gregs
test");
$info->WriteInfo($file);
foreach (keys %$info) {
if ($_ =~ /ObjectName/) {
print "$_: $info->{$_}\n";
}
}
}
}
closedir(DIRHANDLE);
exit;
</code>
To write a respons, access
http://ww
w.cpanforum.com/response_form/2338
To see the full thread, access
http://www.cpan
forum.com/threads/2338
--
You are getting this messages from www.cpanforum.com
To change your subscription information visit http://www.cpanforum.
com/mypan/
|