decimal location coordinates, condense with altitude
[minime.git] / termimg
diff --git a/termimg b/termimg
index 11d436df15546ddc3b4f3f40435bf5760ca9b377..baf6afd0a0cbfaf0087a8135b3e575709747e83f 100755 (executable)
--- a/termimg
+++ b/termimg
@@ -4,7 +4,9 @@ my ($file, $size) = @ARGV;
 
 my @info = eval {
        require Image::ExifTool;
 
 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},
        die "exiftool: $exif->{Error}\n" if $exif->{Error};
        return (
                $exif->{MIMEType},
@@ -25,9 +27,10 @@ my @info = eval {
                        $exif->{ZipModifyDate} //
                        (),
                ),
                        $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})" : (),
                (map "hw $_", join(' ',
                        $exif->{Make} // (), $exif->{Model} // (),
                        $exif->{FOV} ? "(FOV $exif->{FOV})" : (),