#!/usr/bin/perl

use Image::ExifTool;


$file = "./img/IMG_0387.JPG";
print $GPSPosition = &getGps($file);
#print $GPSPosition;

sub getGps{
my $picpath=$_[0];;
#IMG_0387.JPG,IMG_0388.jpg,IMG_0389.jpg
my $exifTool = new Image::ExifTool;
my $exifInfo = $exifTool->ImageInfo($picpath);
my $key;
for $key (sort keys %$exifInfo){
if($key = GPSPosition){
$gps= ("$key : $exifInfo->{$key}\n");
last;
}
}
return $gps;
}