Observation with regards to corrupted DNG and NEF RAW photos

By | February 25, 2019

RAW photos such as DNG and NEF often embed JPEG photos. In case of file corruption it may be useful to ‘recover’ these JPEGs in case repair of the corrupted RAWs is not possible.

I was reading this article: “Lucky Accidents: Viewing Corrupted JPEG Photos in a New Light“. In the comment section the author links to the original corrupted photos. As I am always interested in, in-the-wild corrupted photos to test my software against I downloaded them.

The corrupted NEF photos

I used JPG-Repair Toolkit on the NEF files. No surprises there. Each file embedded an intact (read file not mirroring the corruption like the original NEFs) JPEG, same resolution as the NEF itself.

Corrupt NEF. Clearly 2 images combined.

Corrupt NEF. Clearly 2 images combined.

JPEG extracted from corrupted NEF

JPEG extracted from corrupted NEF

The corrupted DNG photos

DNG files are a different story though! First of all I have never encountered a DNG file yet that embedded a JPEG that is the original size. What was more surprising (to me) is that embedded JPEGs all showed the exact same corruption as the DNG files themselves.

Corrupted DNG photo

Corrupted DNG photo

Corrupted JPEG extracted from DNG photo

Corrupted JPEG extracted from DNG photo

As you can see the corruption in the DNG file is mirrored in the extracted JPEG. The JPEG embedded in the NEF RAW file was generated by the camera sensor it seems and is therefor able to show the intact image while RAW data is corrupted. Embedded JPEGs in DNG RAW photos are not generated from sensor data but from the RAW data within the file itself.

Leave a Reply

Your email address will not be published.