Ever want to change the EXIF data in your pictures? I’ve had this question responded to in the form of another very shortsighted question “Why would you want to do that?” Here are a few reasons why you might want to update your EXIF data.
- Your camera clock went wanky and your pictures came out with the default year of the camera (apparently the vacation we just had actually happened in 2006, at least according to iPhoto).
- You took pictures in another timezone, but your camera clock is still at home.
- You want to resize your photos but retain the EXIF data.
Right, so here is how to do it.
First, grab a brilliant little tool by Phil Harvey called ExifTool. Seriously, thanks a lot Phil, ExifTool really is brilliant. There is a metric butt-load of options for ExifTool, but if you need to just change the date/time the command goes something like this.
exiftool -AllDates=’2014:01:31 15:35:33′ -overwrite_original your_picture_file.jpg
So that’s nice, but how about 2-300 pictures? Here is the one-liner I used to change my sister’s camera photos that were set to the correct time and day but in 2006. There are for sure more elegant ways to write this. This was quick and what came to me so it fit the bill.
for PIC in `ls Camera/`; do DATE=2014:`exiftool ./Camera/$PIC | grep Create | cut -d’:’ -f3-6`; exiftool -AllDates=”$DATE” -overwrite_original ./Camera/$PIC; done
This changed the year in all the date stamps to 2013 while retaining month, day, and time information. Feel free to make it more extensible and elegant as you see fit.