JPEG restart markers to the rescue

By | April 22, 2020

Restart markers make the difference

This YouTube channel by my friend and colleague Nguyễn Vũ Hà has many great examples of JPEG-Repair being used to repair STOP/DJVU ransomware affected files. This video in particular is a great showcase on how JPEG restart markers prevent corruption propagating through the JPEG image stream. As you can see this is a JPEG with restart markers (4/720) which give it excellent survivability in case of corruption. Again, normally JPEG data is one single stream. One corrupt byte affects the rest of the stream that follows this byte too. In case of restart markers, the stream restarts itself at regular intervals (at every n MCUs, n being specified in the header), interrupting corruption preceding it.

In this video JPEG-Repair is used to merge a reference header to the JPEG data, then to remove corrupt data and the result is a near perfectly repaired photo.

Compare to this video from the same channel of a repair of a photo with the exact same type of corruption. Even once the corruption has been removed, from the stream, the rest of the stream suffers from color degradation and image shift. The end result is a presentable photo, but the quality is less than that of the photo with restart markers.

Leave a Reply

Your email address will not be published. Required fields are marked *