Recovering from an “oops”

I had a wonderful time in Williamsburg over vacation, and got to take some photos of the Historic Area in a completely new season. When I got home, however, I remembered taking some photos which hadn’t been imported into Lightroom.

As I pondered these missing photos I quickly realized what had happened. Mid-way through the day I remembered I hadn’t started my GPS app on my phone. As soon as I became aware of this oversight I enabled the app on my phone and began the GPS track for my photos. When the time came to apply the GPS data to my images, however, I had an entire block of photos for which there was no corresponding GPS entry. In and of itself, this was no problem – the images themselves were fine, they just wouldn’t get location data added to them when I ran the gps4cam app on my phone. That step, however, led to me losing the photos.

GPS4cam is a great app which takes all the photos in a folder, searches for a qr code generated by the phone application, automatically accounts for the differences in the phone and camera clocks, and then applies the closest geotag to each photo in the folder. It then deposits these photos in another folder so you know which versions to import into a photo manager like Lightroom. It works great, and I’ve used it with much success.

What I didn’t consider, however, is that any photos which were taken before the GPS track was started will not be moved into the new directory.

And this led to my “oops.”

Chalk it up to the rain, or me not getting enough sleep, or just plain ADD… but I did not notice the sudden absence of over 41 photos from my daily import. I deleted the images from my SD card, wiped the folders from my MacBook, and emptied the trash.

Like I said, “Oops.”

This would have been the end of it, but for a wonderful open source tool called “Photorec.” This is a command-line utility 1, which will scan a volume for specific file types and deposit recovered data into user-identified folder. The reason this works is because when a file is deleted from a disk the only thing deleted is the record of that entry in the file system – the actual data is very much present, at least until something else is written into the same physical space on the disk. As I hadn’t taken any photos since my “oops” I knew the data was still there on my SD card, waiting to be recovered.

I ran the application, selected the file types for which I wanted photorec to search 2, and watched the magic happen. To scan my entire SD card would have taken over an hour, but I knew where my photo gap began and was able to stop the process in under ten minutes. My photos were saved! I even created a Flickr Album for the best of my recovered photos, which you can reach by clicking or tapping the image below.

Preserved Plant

So, in the future, if you accidentally delete files all is not necessarily lost, but you need to move fast to make sure you don’t overwrite all your hidden bits!


  1. This doesn’t mean it’s hard to use, it just means users can’t panic when lots of text appears on the screen. 
  2. During my research I discovered Nikon’s NEF raw files are part of the TIFF spec, so that’s what I set the search to. 
%d bloggers like this: