JpegDigger is a simple freeware utility to extract JPEG files from corrupt RAW files. When cameras are set to capture the RAW format, most manufacturers embed a JPEG image in the RAW file for use when displaying the image on the camera’s LCD or in a browser. In most cases, the embedded JPEG’s quality setting is medium or better. The embedded JPEG is usually smaller than the native resolution of the camera and is developed using the camera’s image settings (white balance, style, exposure) in effect at the time the image was shot.
JpegDigger is kind of a ‘brute force’ tool. Without any knowledge of the internal structures of RAW files it will examine the file for JPEG headers. It does not decode the RAW files. Because it does not rely on internal structures it can be used to find embedded JPEGs in and extract JPEG files from corrupt RAW files.
To support the different proprietary RAW image file formats it uses several JPEG signatures (magic numbers). I determined those manually examining the different RAW files using a hex editor. Once it finds JPEG data, it opens a file and dumps the binary data to this file and saves it with a JPG extension.
While chances of ‘recovery’ may appear to be good if a preview is shown (in the OS or on-camera), also when no preview is shown you should give JpegDigger a shot. No preview does not imply there is no JPEG present inside the RAW file. If the file structure is corrupt Windows or your software simply can not parse the file and therefor can not show a preview.
Please note that your RAW files may appear to be corrupt if the RAW software you’re using is too old (meaning too old to handle a newer RAW file format). Always make sure to use the latest version of your RAW file processing software.
[SHA256 (of exe): 92e4fb48f64a65956668e7633c72356c09f75d1f36d57f332f1cedc16e235eb1]
File is a standalone EXE. No Setup. JpegDigger is free of viruses, malware or other crapware.
Supported RAW files
If the format your camera shoots isn’t listed here you can email me an intact file. I will examine the file and if possible add support for it.
Please note that there is no RAW image file format specification that for example determines that a RAW image file embeds JPEG data. It is the camera manufacturers that come up with their own specification. It appears most of those are based on the TIFF format, but with modified headers and additional tags (sections).
And even among files with the same extension, there appear to be differences: I have .DNG files here, some do not have JPGs embedded, some do 1, and some even 2.
Extract JPEG files from corrupt RAW files
JpegDigger is very easy to use:
Select the location of the corrupt RAW files. JpegDigger will automatically create a output folder in the directory as well. It is therefor advised to store the corrupt files on your hard drive rather than a memory card.
Select scan depth. All files I tested went fine with the default setting. You also need to select the file extension. JpegDigger now examines the RAW files and see if there are any JPG files to extract. A file can of course be too corrupt.
If you have experience with a specific scan depth for a specific RAW file, please share!
JpegDigger was created out of an immediate need. Because of My Jpeg repair service people also contact me to ask if I can repair corrupt RAW image format files. I can not at this time, nor do I have the time to investigate these file formats.
It is common knowledge that a lot of RAW image files contain embedded JPEGs and for some that is better than nothing at all. For those people I was able to Extract JPEG files from RAW image files on several occasions. I use a hex editor for that. Some times I do it for free (for a few files), normally I charge the ‘Low Res Preview’ extraction fee (see).
At some point I had to do a huge load of .NEF (Nikon RAW files) so I decided it was time to put together a utility (JpegDigger) to process all .NEF files in a given directory.
Note this software is quad (quick and dirty) and there is lot’s of room for optimization. Which I will do as soon as I find the time. Anyway, you need to consider that the initial impulse to write the tool is for me to have something to extract JPEGs from RAW files automatically. Until now I had to:
- Open each RAW file in a hex editor.
- Search for a JPEG header.
- Search for an end marker.
- Copy the block between the two into another file with a .JPG extension.
So there you have it. Far from perfect and nothing like the awesome JPEGsnoop, but it fits my needs.
To determine signatures I examined RAW files taken from: http://www.rawsamples.ch/index.php/en/canon.
Version 184.108.40.206 – initial release
Version 220.127.116.11 – Start program by dropping RAW file on EXE, Better EOF detection (for the JPEG).