Shows picture exif GPS info if any and converts coords to a decimal degree number
identify -verbose my_image.jpg | awk 'function cf(i){split(i,a,"/");if(length(a)==2){return a[1]/a[2]}else{return a[1]}}/GPS/{if($1~/GPSLatitude:|GPSLongitude:/){s=$0;gsub(/,/,"",$0);printf("%s (%f)\n", s, $2+cf($3)/60+cf($4)/3600)}else{print}}'
This oneliner uses Imagemagic's identify utility to show the exif GPS information of an image an also converts Grad/MIn/Sec representation to a decimal degree number
Sample Output
exif:GPSAltitude: 1665000/1000
exif:GPSAltitudeRef: 0
exif:GPSDateStamp: 2017:10:25
exif:GPSInfo: 3166
exif:GPSLatitude: 47/1, 39/1, 403802/10000 (47.661217)
exif:GPSLatitudeRef: N
exif:GPSLongitude: 11/1, 47/1, 374272/10000 (11.793730)
exif:GPSLongitudeRef: E
exif:GPSMapDatum: WGS-84
exif:GPSProcessingMethod: ASCII
exif:GPSTimeStamp: 10/1, 32/1, 53/1
exif:GPSVersionID: 2, 2, 0, 0
<a href="https://number4.ir">???? ????? ????? ?????</a>
man ls
man ls