How to automatically remove all EXIF information from photos inside a folder

I just found a few photos I’d like to use on the Internet and I wanted to remove all the EXIF information from it.

EXIF information contains the camera used and some of the settings and even where you made the photo on cameras with GPS.

I didn’t want to remove it from every single photo, so I made a script for it:


#!/bin/bash
#This script deletes all EXIF information from any .JPG or .jpg photo in a folder. It is needed to install ImageMagick to use the mogrify command.
#NOTE: YOUR EXIF WILL BE LOST! DO A BACKUP IF YOU NEED IT!
# This program comes with absolutely no warranty, to the extent permitted by applicable law.
cd ~/YOUR_PICTURE_FOLDER/
clear
echo Now locating pictures and deleting EXIF information
find ./*/ -name '*.JPG' | xargs mogrify -strip
clear
echo step 1 of 4 done...
find ./*/ -name '*.JPG~' | xargs rm
clear
echo step 2 of 4...
find ./*/ -name '*.jpg' | xargs mogrify -strip
clear
echo step 3 of 4...
find ./*/ -name '*.jpg~' | xargs rm
clear
echo step 4 of 4...
#The above lines containing 'rm' remove the .JPG~ or .jpg~ files, which you get when you close the program before finishing. Just run it again to get rid of them.
echo 'We are done! You can now use your photos on the Internet! Press any key to continue.. :)'
read -n 1
echo
exit

This simple script needs the program ImageMagick installed to have the mogrify command available.

Use it at your own risk.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.