Bulk renaming digital photos for easier identification

Managing digital content can be a pain sometimes. Managing my own photos is bad enough (and I have applications like Adobe Lightroom to help with my Digital Asset Management) but when other family members want help whilst sorting through thousands of photos from multiple cameras to make a calendar or a yearbook it can get very messy.

For a long time now, I’ve used a Mac app called Renamer to bulk rename files – for example, batches of photos after importing them from my camera.  The exception to this is my iPhone pictures, which Dropbox rather usefully renames for me on import using the date and time, suffixing as necessary to deal with HDRs, etc. I only have a couple of gigabytes on Dropbox, so I move the renamed files to OneDrive (where I have over a terabyte of space…). The problem with this is that there needs to be enough space on Dropbox for the initial import – which means I have to use a particular PC which recognises my iPhone and remembers which photos have previously been imported. If I use another PC it will try and re-import them all (and fail due to a lack of available space)…

My wife has a different system. She also uses OneDrive for storage but has some files that have been renamed by Dropbox (to yyyy-mm-dd hh.mm.ss.jpg), some that have been renamed on import by something else (to yyyymmdd_hhmmsssss_iOS.jpg) and some that are just copied directly from the iPhone storage as IMGxxxx.jpg. My task? To sort this lot out!

Multiple images with the same time stamp

We decided that we liked the Dropbox name format. So that became the target. I used Renamer to rename files to Year-Month-Day Hour.Minutes.Seconds.jpg (based on EXIF file data) but the presence of HDR images etc. meant there were duplicates with the same time where a whole second wasn’t fine-grained enough. We needed those fractions of a second (or a system to handle duplicates) and Renamer wasn’t cutting it.

The fallback was to use the original filename as a tie-break. It’s not pretty, but it works – Year-Month-Day Hour.Minutes.Seconds (Filename).jpg gave my wife the date/time-based filename that she needed and the presence of the original filename was a minor annoyance. I saved that as a preset in Renamer so that when I need to do this again in a few months, I can!

Renaming digital photos in Renamer using a preset

No EXIF data

Then the files with no EXIF data (.MOVs and .PNGs) were renamed using a similar preset, this time using the modification date (probably less reliable than EXIF data but good enough if the files haven’t been edited).

Thousandths of seconds

Finally, the files with the odd format. Mostly these were dealt with in the same was as the IMGxxxx.jpg files but there were still some potential duplicates with the same EXIF timestamp. For these, I used progressive find and replace actions in Renamer to strip away all but the time a RegEx replacing ...... with nothing allowed me to remove all but the last three characters (I originally tried .{3}$ but that removed the 3 characters I actually wanted from the tail end that represent thousandths of seconds). One final rename using the EXIF data to Year-Month-Day Hour.Minutes.Seconds.Filename.jpg gave me yyyy-mm-dd hh.mm.sssss.jpg – which was close enough to the desired outcome and there were no more duplicates.

What’s the point? There must be a better way!

Now, after reading this, you’re probably asking “Why?” and that’s a good question. After all, Windows Explorer has the capability to provide image previews, the ability to sort by date, etc. but it’s not up to me to question why, I just need an answer to the end-user’s question!

Using Renamer is reliant on my Mac – there are options for Windows like NameExif and Stamp too. I haven’t used these but it appears they will have the same issues as Renamer when it comes to duplicate timestamps. There’s also a batch file option that handles duplicate timestamps but it doesn’t use the EXIF data.

Meanwhile, if anyone has a script that matches the Dropbox file rename functionality (including handling HDRs etc. which have identical timestamps), I’d be pleased to hear from you!

[Update 1 January 2017: These Python scripts look like they would fit the bill (thanks Tim Biller/@timbo_baggins) and James O’Neill/@jamesoneill reminded me of ExifTool, which I wrote about a few years ago]

Leave a Reply