Edit Picture Metadata With exiv2

Have you ever uploaded your pictures from a camera only to find out that the your cameras dates and times had reset to the wrong date? Then, have you ever wanted to change images metadata to the correct dates and times? This is a problem that I encounter every once in a while and it usually becomes a chore to find a utility to change this data. I've discovered a great command line program to fix all your metadata problems, exiv2.

apt-get install exiv2

Below is a listing of a few examples. In the examples below, pic_name.jpg is an arbitrary picture file. Multiple files can specified as well as wild cards.

Command Result
exiv2 pic_name.jpg
Print the picture's meta data
exiv2 ad -Y 5 -O 4 -D 23 pic_name.jpg
Modify date to +5 years, +4 months, and +23 days. (Note: negative values can be given to go backwards)
exiv2 mv pic_name.jpg
Rename pic_name.jpg to its YYYYMMDD_HHMMSS.jpg (i.g. Picture taken on Oct 1, 2009 at 12:30:02 will be named 20091001_123002.jpg)

If you want to learn more about exiv2 you can check out the man page at http://linux.die.net/man/1/exiv2 or install it and check the man pages on your own machine.