ExifTool Forum

ExifTool => The Image::ExifTool API => Topic started by: dschless on April 08, 2010, 04:13:53 PM

Title: TagInfoXML call
Post by: dschless on April 08, 2010, 04:13:53 PM
I'm trying to call TagInfoXML::Write...

my %opts;
$opts{Flags} = 1;
$opts{NoDesc} = 1;
Image::ExifTool::TagInfoXML::Write('temp.xml', 'EXIF', %opts);

or should I use
Image::ExifTool::TagInfoXML::Write('temp.xml', 'EXIF', \%opts);

Neither option seems to give the desired results...

Thanks,
Dan Schless
Title: Re: TagInfoXML call
Post by: Phil Harvey on April 08, 2010, 04:37:15 PM
Hi Dan,

The correct form is to pass the hash directly as "%opts".

The problem is my fault, and is due to an incorrect function template.  I will fix this in the next release.  Until then you can work around the problem by loading the module with "require" instead of "use".  ie)

require Image::ExifTool::TagInfoXML;
my %opts;
$opts{Flags} = 1;
$opts{NoDesc} = 1;
Image::ExifTool::TagInfoXML::Write('temp.xml', 'EXIF', %opts);


The options hash argument is a scalar in the prototype so Perl is converting the hash to a scalar which is causing the problem.  This will be fixed in 8.17.

Thanks for bringing this to my attention.

- Phil