[SOLVED] Batch: Stripping EXIF metadata + Preserving of the original date
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Batch: Stripping EXIF metadata + Preserving of the original date
I would like to remove almost all of the Privacy Evading data that a digital camera is generating, such as EXIF DATA. EXIF DATA: Camera Brand, Camera Model, Date taken, Exposure Time, Flash Fired, Focal Length, Location (if you are using iPhone with categorization by location, if enabled), Metering Mode, etc.
May you, please, write a script which does that job for multiple files?
Exiv2 seem to reduce more weight than Jhead so I'll use the command exiv2.
That's, generally, what I want the script to do:
Retrieve the (Modified) date of a file:
Code:
$ date -r FILE_NAME
Output:
Code:
Thu Feb 3 20:55:12 IST 2011
Remove EXIF metadata from a file:
Code:
$ exiv2 rm FILE_NAME
Modify the (Modified) date of a file:
Code:
$ touch -d 'Thu Feb 3 20:55:12 IST 2011' FILE_NAME
Last edited by Tryum; 02-23-2011 at 11:04 AM.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Hi,
If I understand you correctly, you want to remove all exif info from the file while preserving the original date of the file; and you have figured out a way to do that for one file and want to batch process all the files using a script.
Assuming that your directory contains only files that you want to touch-up, this can be a way batch process them for the commands you have listed.
Code:
#!/bin/bash
cd your-direcotry
for file in `ls`; do
DATE=`date -r $file`
exiv2 rm $file
touch -d $DATE $file
done
Hi,
If I understand you correctly, you want to remove all exif info from the file while preserving the original date of the file; and you have figured out a way to do that for one file and want to batch process all the files using a script.
Assuming that your directory contains only files that you want to touch-up, this can be a way batch process them for the commands you have listed.
Code:
#!/bin/bash
cd your-direcotry
for file in `ls`; do
DATE=`date -r $file`
exiv2 rm $file
touch -d $DATE $file
done
Thank you all for your, absolutely, important help!
It is exactly what I wanted.
And, of course, it is touching files without EXIF metadata within them, but it really does not matter (who cares, as long as the original modification date is the same, right?!). ;P
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.