I have taken some photos on my Ubuntu machine, and I'd like to know whether they contain geolocation, and if so, what are they.
How can I do that?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
exiftool can be used to print out the metadata of the image. If the location was stored when the image was taken (usually called 'geotagging'), you can find it there:
$ exiftool 23.jpg | grep GPS GPS Latitude Ref : North GPS Longitude Ref : East GPS Latitude : 35 deg 32' 16.80" N GPS Longitude : 139 deg 29' 49.20" E GPS Position : 35 deg 32' 16.80" N, 139 deg 29' 49.20" E $
You can also use exiftool to strip the GPS information out of an existing image:
$ exiftool -gps:all= 23.jpg 1 image files updated $ exiftool 23.jpg | grep GPS $
Any tool that can look at image metadata can look at this information. For example, the
identify tool from ImageMagic will also do it:
$ identify -verbose 23.jpg | grep GPS exif:GPSInfo: 640 exif:GPSLatitude: 35/1, 3228/100, 0/1 exif:GPSLatitudeRef: N exif:GPSLongitude: 139/1, 2982/100, 0/1 exif:GPSLongitudeRef: E $
and GUI tools can often do so as well - here's Image Viewer from Ubuntu 18:
Many images do not have GPS entries in their metadata - for example, if you take a picture with a camera that doesn't have GPS, it won't store it - here's a list of cameras that do have GPS.