Since I had posted my first thoughts on how to remove "sensitive" meta data from files before uploading them back in February, I have modified the command a little since and made it a permanent alias so it is easier to execute.
This is what it looks now in my .bash_aliases:
alias strip_exif='exiftool -all= *.jpg; find . -maxdepth 1 -name "*jpg" -execdir exiftool -overwrite_original -tagsfromfile {}_original -make -model -exposuretime -fnumber -flash -iso -lens -focallength -orientation -datetimeoriginal {} \;; rm *original'
For this alias to be found by bash at all it is necessary to add/uncomment the following lines in the .bashrc:
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
What this alias "strip_exif" does is:
- Remove all meta data from the image files (with jpg extension) from the directory the command is executed from. By default ExifTool will make a backup copy of the modified files. They can be found in the same directory with an appendend _original.
- Using the find-command I retrieve all image filenames (again looking for the jpg extension) in the current directory (that's why I specifiy the maxdepth parameter) and then pass those on to ExifTool which then processes one by one. It simply copies the defined meta data fields from the _orignal backup files. (For an extensive list of available meta data have a look at man Image::ExifTool::TagNames and do a /EXIF Tags)
- Finally the backup files are removed leaving me with the directory listing that I started out with but with only a fraction of the meta data in the files.
Maybe this is helpful to someone. :)
Send a message
Search for members