skip to Main Content

Renaming pictures by IMG sequence number

We recently had a client with an unreadable SD card containing pictures. To get the best result we performed a raw recovery which ignores the filesystem and filenames, instead recovering by file type (eg: pictures).

When cameras take pictures they embed extra information called EXIF. In these cases we use EXIF information to rename photos by date taken which is usually relevant to our clients however in this case the client needed the actual filenames.

Luckily some cameras embed the sequence number within EXIF data which we used to rename the files. Now the trick was figuring out how to read this information and rename the files accordingly. Luckily I stumbled upon a cool utility called ExifTool.

In my case I downloaded the windows version and renamed it to exiftool for ease of use then dragged the folder containing the pictures into the same folder as exiftool.
The command line breaks down as follows ${fileindex} is the sequence number, %e is the file extension (ie: .jpg) and β€œ.\pictures” is the folder that contained the data.

exiftool.exe "-filename<IMG_${fileindex}.%e" ".\pictures"

Very cool, crisis averted and the client was happy πŸ™‚