Skip to content

Instantly share code, notes, and snippets.

@hirose31
Created December 19, 2008 16:53
Show Gist options
  • Save hirose31/38042 to your computer and use it in GitHub Desktop.
Save hirose31/38042 to your computer and use it in GitHub Desktop.
use Image::ExifTool qw(ImageInfo);
use Image::ExifTool::GPS;
for my $img (@ARGV) {
my $exif = Image::ExifTool->new;
# $exif->Options(CoordFormat => '%d degrees %.2f minutes');
my $info = $exif->ImageInfo($img);
my @tags = $exif->GetTagList($info, 'Group0');
#d ¥@tags;
for my $tag (@tags) {
next unless $tag =‾ /^GPS/;
my $val = $info->{$tag};
printf "%s: %s¥n", $tag,$val;
}
}
__END__
GPSVersionID: 2.2.0.0
GPSLatitudeRef: North
GPSLatitude (1): 35 deg 39' 45.00"
GPSLongitudeRef: East
GPSLongitude (1): 139 deg 43' 58.80"
GPSLatitude: 35 deg 39' 45.00" N
GPSLongitude: 139 deg 43' 58.80" E
GPSPosition: 35 deg 39' 45.00" N, 139 deg 43' 58.80" E
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment