How can I recursively remove the EXIF info from several thousand JPG files?
Linux Bash – Batch Delete EXIF Info from Images
bashexifimage manipulationlinux
Related Solutions
The EXIF handling tool exiv2
has a builtin option for this:
exiv2 -T rename image.jpg
sets the time of last file modification, mtime
, to the date stored in the EXIF metadata.
You asked for using the create time - but that is not used in Unix-like systems - and there are good reasons for that: https://unix.stackexchange.com/questions/27297/why-doesnt-nix-keep-track-of-file-creation-time
I'm pretty sure the time you call create time is actually mtime
- no problem there.
From man exiv2
:
NAME
exiv2 - Image metadata manipulation tool
SYNOPSIS
exiv2 [options] [action] file ...
DESCRIPTION
exiv2 is a program to read and write Exif, IPTC and XMP image metadata and image com‐
ments. The following image formats are supported:
[ ... ]
mv | rename
Rename files and/or set file timestamps according to the Exif create time‐
stamp. Uses the value of tag Exif.Photo.DateTimeOriginal or, if not
present, Exif.Image.DateTime to determine the timestamp. The filename for‐
mat can be set with -r fmt, timestamp options are -t and -T.
[ ... ]
-T Only set the file timestamp according to the Exif create timestamp, do not
rename the file (overrides -k). This option is only used with the 'rename'
action. Note: On Windows you may have to set the TZ environment variable for
this option to work correctly.
See option -t
to do the opposite.
The tool you need is called jhead
. Some OSs release it via their package managers, but this is the home of jhead, and you can download the latest version from there.
From the jhead
manual:
-ta Adjust time stored in the Exif header by h:mm forwards or backwards. Useful when having taken pictures with the wrong time set on the camera, such as after travelling across time zones, or when daylight savings time has changed. This option uses the time from the "DateTimeOriginal" (tag 0x9003) field, but sets all the time fields in the Exif header to the new value.
Examples:
Adjust time one hour forward (you would use this after you forgot to set daylight savings time on the digicam)
jhead -ta+1:00 *.jpg
Adjust time back by 23 seconds (you would use this to get the timestamps from two digicams in sync after you found that they didn't quite align)
jhead -ta-0:00:23 *.jpg
Adjust time forward by 2 days and 1 hour (49 hours)
jhead -ta+49 *.jpg
Best Answer
The other ExifTool suggestions are great if you want to remove or change specific sections. But if you want to just remove all of the metadata completely, use this (from the man page):
You could also use jhead, with the -de flag:
Note that in both cases, EXIF is only one type of metadata. Other metadata sections may be present, and depending on what you want to do, both of these programs have different options for preserving some or removing it all. For example,
jhead -purejpg
strips all information not needed for rendering the image.