I wanted to share publicly some photos, but I performed them with navigation enabled so they contained accurate localization of my house. I wanted to remove EXIF data GPS tags, my phone type and other irrelevant stuff.


There’s a way that requires less effort. Check how to automate this process with pre-commit hooksexternal link .


You will need imagemagick installed (use apt/yum/dnf of whatever you have there):

Install imagemagick
sudo apt install -y imagemagick

To remove them just use:

Strip EXIF data
mogrify -strip image.jpg

How to check if it’s working?

First, let’s get some example images 1.

Source: github.com/ianare/exif-samples

To check what tags image provides, you can use identify tool (I limited output to only GPS data because it’s just too much stuff there):

Review EXIF data
identify -verbose image.jpg | wc -l

identify -verbose image.jpg | grep GPS
    exif:GPSAltitudeRef: 0
    exif:GPSDateStamp: 2008:10:23
    exif:GPSInfo: 926
    exif:GPSLatitude: 43/1, 28/1, 281400000/100000000
    exif:GPSLatitudeRef: N
    exif:GPSLongitude: 11/1, 53/1, 645599999/100000000
    exif:GPSLongitudeRef: E
    exif:GPSMapDatum: WGS-84
    exif:GPSSatellites: 06
    exif:GPSTimeStamp: 14/1, 27/1, 724/100

There was 156 lines of different tags!

After cleanup:

Check EXIF data again
identify -verbose image.jpg | wc -l

identify -verbose image.jpg | grep GPS

you will get only generic information data, without any GPS tags.