How to Sanitize EXIF Data From Your Pictures

Linux Exif Data and Personal Security

When you take pictures, be it with your cell phone or with your digital camera, the software adds data to the pictures. This data is called the Exif data. If your camera supports it, and if you have it enabled, it will encode all sorts of private data along with your image data.

Needless to say, this is a potential privacy nightmare and people have not only been doxxed this way but people have ended up in jail because of leaving the data in their photos. Now, frankly, if you’re taking images that’d get you tossed into jail, I’m pretty much okay with that. For the rest of you, read on…

First, install exiftool from your default repositories. If you’re using apt, it’s quite simple and almost certainly in your default repositories.

[code]sudo apt install exiftool[/code]

Now, let’s make it work. Open your .bash_aliases file, assuming you have one, and add the following line:

[code]alias picclean=”exiftool -overwrite_original -all= *.png && exiftool -overwrite_original -all= *.jpg && echo $PWD ‘images cleaned for privacy sake!'”[/code]

Now, reload your aliases with:

[code]source ~/.bash_aliases[/code]

To use this, open the directory that houses the photos you want to share with your terminal and just enter:

[code]picclean[/code]

That will clean all your .png and .jpg files. That’s also enough information for you to customize it for your system, should you have a different configuration than I.