ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: StarGeek on July 24, 2019, 02:23:58 PM

Title: problem with config file, change between ver 11.53 and 11.54
Post by: StarGeek on July 24, 2019, 02:23:58 PM
My GPS2MapUrl.config file (https://exiftool.org/forum/index.php/topic,9862.msg51226.html#msg51226), which previously worked, currently returns an error:
Warning: ValueConv GoogleMapsUrl: Can't use an undefined value as a HASH reference

I narrowed it down to the changes between version 11.53 (still works) and 11.54 (returns error).

The command is
exiftool_11.54.exe -config GPS2MapUrl.config  -GoogleMapsUrl y:\!temp\Test4.jpg
but it  also fails with
exiftool_11.54.exe -config GPS2MapUrl.config  -GoogleMapsUrl -userparam zoom=12 y:\!temp\Test4.jpg

The basic code of the config file is (full config file in the above link)
GoogleMapsUrl => {
Require => {
0 => 'GPSLatitude',
1 => 'GPSLongitude',
},
ValueConv => q{
my $zm = ($self->Options('UserParam')->{'zoom'}) ? "&ll=$val[0],$val[1]&z=".($self->Options('UserParam')->{'zoom'}) : undef;
return ("https://www.google.com/maps/search/?q=$val[0],$val[1]$zm");
},
},


So I'm guessing the problem is with the $self->Options('UserParam')->{'zoom'} part, which is the only hash part, as far as I can tell, but it also fails when I include the UserParam, so I'm at a bit of a loss as how to fix it.

Title: Re: problem with config file, change between ver 11.53 and 11.54
Post by: Phil Harvey on July 24, 2019, 04:15:38 PM
Thanks for this report!  It will be fixed in 11.58.

Really good catch.

I introduced this bug when I added a patch to support backward compatibility for the old Compact and XMPShorthand options.

- Phil

Edit:  Note that even with 11.53, your config file will return a warning about an uninitialized value under some circumstances (eg. exiftool -p "$test" FILE). Instead of "undef", you should set $zm to an empty string if there is no "zoom" parameter.
Title: Re: problem with config file, change between ver 11.53 and 11.54
Post by: StarGeek on July 24, 2019, 05:57:14 PM
Quote from: Phil Harvey on July 24, 2019, 04:15:38 PMyou should set $zm to an empty string if there is no "zoom" parameter.

Sounds good.  I'll fix that later today.