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.
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.
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.