#!/bin/bash # geoloc -- for images that have GPS information, convert it into a string # that can be fed to Google Maps or Bing Maps. setglobal tempfile = ""/tmp/geoloc.$Pid"" trap "$[which rm] -f $tempfile" 0 1 15 if test $Argc -eq 0 { echo "Usage: $[basename $0] image" > !2 ; exit 1 }for filename in @Argv { identify -format "%[EXIF:*]" $filename | grep GPSL > $tempfile setglobal latdeg = $[head -1 $tempfile | cut -d, -f1 | cut -d= -f2] setglobal latdeg = $[scriptbc -p 0 $latdeg] setglobal latmin = $[head -1 $tempfile | cut -d, -f2] setglobal latmin = $[scriptbc -p 0 $latmin] setglobal latsec = $[head -1 $tempfile | cut -d, -f3] setglobal latsec = $[scriptbc $latsec] setglobal latorientation = $[sed -n '2p' $tempfile | cut -d= -f2] setglobal longdeg = $[sed -n '3p' $tempfile | cut -d, -f1 | cut -d= -f2] setglobal longdeg = $[scriptbc -p 0 $longdeg] setglobal longmin = $[sed -n '3p' $tempfile | cut -d, -f2] setglobal longmin = $[scriptbc -p 0 $longmin] setglobal longsec = $[sed -n '3p' $tempfile | cut -d, -f3] setglobal longsec = $[scriptbc $longsec] setglobal longorientation = $[sed -n '4p' $tempfile | cut -d= -f2] /bin/echo -n "Coords: $latdeg $(latmin)' $(latsec)\" $latorientation, " echo "$longdeg $(longmin)' $(longsec)\" $longorientation" } exit 0