From 012b190991e70234b3dd58f3a98ed39a83b295a0 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Fri, 14 Feb 2020 23:40:59 +0100 Subject: [PATCH 1/1] decimal location coordinates, condense with altitude Most mapping services read decimal lon/lat values, not "human" degrees. --- termimg | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/termimg b/termimg index 11d436d..baf6afd 100755 --- a/termimg +++ b/termimg @@ -4,7 +4,9 @@ my ($file, $size) = @ARGV; my @info = eval { require Image::ExifTool; - my $exif = Image::ExifTool->new->ImageInfo($file); + my $exif = Image::ExifTool->new->ImageInfo($file, { + CoordFormat => '%.5f', + }); die "exiftool: $exif->{Error}\n" if $exif->{Error}; return ( $exif->{MIMEType}, @@ -25,9 +27,10 @@ my @info = eval { $exif->{ZipModifyDate} // (), ), - $exif->{GPSPosition} ? $exif->{GPSPosition} =~ s/ deg/./gr : - $exif->{Location} ? $exif->{Location} : (), - $exif->{GPSAltitude} ? $exif->{GPSAltitude} : (), + join(', ', + $exif->{GPSPosition} // $exif->{Location} // (), + $exif->{GPSAltitude} // (), + ), (map "hw $_", join(' ', $exif->{Make} // (), $exif->{Model} // (), $exif->{FOV} ? "(FOV $exif->{FOV})" : (), -- 2.30.0