Skip to content

Instantly share code, notes, and snippets.

@shoorick shoorick/
Created May 11, 2010

What would you like to do?
Print out GPS coordinates from images
#!/usr/bin/perl -wl
use strict;
Print out GPS coordinates from images
=head1 AUTHOR
Alexander Sapozhnikov
L<< E<lt> shoorick at E<gt> >>
use Image::ExifTool qw(:Public);
foreach my $file ( @ARGV ) {
my $info = ImageInfo($file);
my @gps = ( $$info{'GPSLatitude'}, $$info{'GPSLongitude'} );
print $file, ' - ', join( q{,}, map { &convert } @gps ), ' < ', join( q{,}, @gps );
} # foreach
sub convert {
return '?'
unless /(\d+) deg (\d+)' ([\d\.]+)"/;
my $coord = $1 + $2/60 + $3/3600;
$coord = -$coord
if /[WS]$/;
return $coord;
} # sub convert

This comment has been minimized.

Copy link
Owner Author

shoorick commented May 11, 2010

Выводит сохранённые в EXIF географические координаты у изображений, переданных в качестве аргументов.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.