Archive for August, 2012

Quickly recover images from an iPhone backup

Tuesday, August 14th, 2012

If you accidentally delete images from your iPhone (or in my case allow iPhoto to delete them after an import only to find the import corrupted them) you can easily recover the images using this method so long as:

  • You backup your iphone using iTunes
  • The backup is unencrypted
  • You haven’t backed-up (backuped?) the iPhone since the images were deleted

The first thing to do is find the backup folder on your harddrive. It should be in “~/Library/Application Support/MobileSync/Backup”. You’ll have a folder in there for every device you back up, finding out which one is for the current device is an exercise for the reader.

Inside your selected folder will be a lot of files. I have 6000+. The ones you are interested in vary according to which device and which camera (front or back) took the photo. You can guess the size of the standard jpegs your camera produces or just grab all the files between 1 and 6mb. Copy them to another folder and open a Terminal window there.

Now run this command in the terminal to give all the files a .jpg extension.

for i in *; do mv "$i" "${i}".jpg; done

Most of the files will now open in Preview so you can find your lost photo. The files that don’t open weren’t really jpegs. They might be pngs if they were screenshots, or they could be any other file from your device.