Sorting Photos

My photos were very disorganized, especially after recovering them from my accidentally formatted hard disk.

A word of warning: SATA hard drives do not show as drive C: in the Windows XP installer, unless there are no IDE drives, so if you have more then one hard drive don’t trust the drive letters when installing Windows.

So I wrote this bash script to copy my pictures into folders by date. It uses jhead to get the date, and if that doesn’t work it uses the files modified date. So the final path ends up being something like: “/2005/01.Jan 17/10.34.23 IMG_1045.JPG”. This format is fairly easy to change by editing the script.

The script also makes sure that Picasa.ini entries stay with the photos, so if you use Picasa (like me) your edits and stars will stay with the images when they are copied.

To get the script to work on Windows you’ll need cygwin and jhead.

Comments are closed.