msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

14 Jan 2008 Rename image files according to EXIF date

Posted by

This rename trick can be run in Windows, Linux and even Mac since the commandline program I’m going to use, exiv2, is available in all three platforms. Rename all image files in current folder to the format YYYYMMDDHHMM_Filename.EXT

This has been tested on my Nikon D80 JPEG and NEF image files.

Linux

exiv2 -r'%Y%m%d-%H%M_:basename:' rename $(ls)

Windows (from the command prompt)

exiv2.exe -r %Y%m%d-%H%M_:basename: rename d*

Windows (in a MS-DOS batch file)

exiv2.exe -r %%Y%%m%%d-%%H%%M_:basename: rename d*

You have to add an extra % if you are going to use exiv2 in a Windows batch file, because % in batch files is treated as a variable and not as a switch to exiv2.

These examples require that you have access to the exiv2 program from the current folder.

Result
Now my image files have names like

20071022-1202_DSC_9727.JPG
20071022-1202_DSC_9727.NEF

Change in workflow
Since I rename all my files in the format YYYYMMDD-HHMM_Filename I’ve included it in my image “workflow” (a simple MS-DOS batch file) I wrote about in Rotate images depending on the EXIF orientation post.

This has been tested successfully on the Windows exiv2 version 0.16

The new batch file can be downloaded here.

Tags: , , , , , , , ,

Reader's Comments

  1. |

    Why not simply use the RenRot tool?

  2. |

    Because I wasn’t aware of renrot until now.
    Thanks for the tip anyway