Featured image of post Removing image EXIF data in Linux

Removing image EXIF data in Linux

Using 'exiftool'.

Overview

In creating this website, I wanted to use photos in the blog posts. However, from a privacy point of view, I wanted to strip some of the EXIF data from the images to clear things like GPS coordinates etc.


Installing EXIFTool

I am using Pop!_OS, but these instructions should work for any Ubuntu/Linux Mint/Debian base etc OS.

Check out the EXIFTool documentation for more information.

  • Install EXIFTool:
1
sudo apt-get install libimage-exiftool-perl

 

Using EXIFTool

Read all the EXIF data from an image:

1
exiftool image.jpg

 

Remove all metadata from an image:

1
exiftool -all= image.jpg

You can apply this to multiple files, e.g. exiftool -all= * or exiftool -all= *.png

 

Remove only GPS metadata:

Once you have looked through the metadata tags that are read from the initial read command, you can remove specific ones:

1
exiftool -GPS*= -a

The -a flag removes the same tag from different groups

Built with Hugo
Theme Stack designed by Jimmy