5

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?

migrated from security.stackexchange.com Oct 27 '18 at 8:12

This question came from our site for information security professionals.

  • This depends on the software you used. What software did you use? – forest Oct 17 '18 at 1:35
  • 1
    Ever see this website (platform independent)? exif.regex.info/exif.cgi Note: you are uploading your photos to a third party, make sure you are OK with them being on the front page of the Sunday Times before uploading. – HashHazard Oct 17 '18 at 2:37
10

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:

Image Viewer Details/Metadata

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.

Most cell phones, of course, have a GPS, and often will geotag by default. You can choose to disable this in Android and iPhones.

  • Thanks. How can I install exiftool on Ubuntu? – wbad Oct 17 '18 at 19:31
  • 1
    @randon sudo apt install exiftool will install it for you. – gowenfawr Oct 17 '18 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.