TagInfoXML call

Started by dschless, April 08, 2010, 04:13:53 PM

Previous topic - Next topic

dschless

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

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).