A small Python program for recovering JPEG images from an accidentally erased/damaged memory card
The program takes as its input a given disk image file. In order to recover photos from a memory card, you will first have to make a disk image of that memory card. Methods for doing this vary across systems. On Mac OSX, you can insert the memory card into the computer and then open the Disk Utility application. Create a new Disk Image from the memory card. Make sure that you are not using any kind of compression -- we need this to be a straight copy of the bytes.
Place the script and the disk image in a directory where you want the photos to go. Open a Terminal window (the Terminal application on Mac OSX) and navigate to that directory using
cd
type the following command:
python jpegrecover2.py
You will then be asked to provide the filename for the disk image file, followed by a "prefix" for recovered images. What does this mean? Let's say I choose "recovered" as my prefix. As the images are written, each file will have "recovered" followed by a number as its filename. That's all it means.
jpegrecover2.pyis recommended for use, as it's the latest and best refactored version of the program. The old file is there only temporarily.