Describes JPEG somewhat and the underlying method used by JPEG-repair. In essence JPEG-Repair is a hex editor which provides visual feedback.
How to recognize different types of JPEG corruption. Simply put, the JPEG consists of a header and the image data. Damage limited to the header results in an image that can’t be viewed at all. Damage limited to image data can often be opened and viewed but the image is distorted.
How to repair corrupted JPEG headers. Corrupted headers result in different photo viewers and editor refusing to open the photo at all. The most bullet proof repair is replacing the corrupted header with a good one. For this to work, some points of reference need to be present in the corrupted file. It also requires a reference file which can be used as a ‘donor’.
How to get use-able data from corrupted RAW photos such as Cr2 (Canon) and NEF (Nikon). JPEG-Repair does not actually repair such photos but is often able to extract high-res JPEGs from them.
Patching RAW JPEG data with visual feedback to repair color errors and image shift and also grey blocks. In Patch mode more advanced repairs are also possible: For example, using JPEG-Repair you can glue a JPEG header to arbitrary data which can be useful when trying to repair severely corrupted files.
Even with the entire header gone and only part of JPEG bitstream it is sometimes possible to get presentable images.
Unfortunately, often the question is now how a photo can be repaired, but if it can be repaired. JPEG-Repair Toolkit offers some tools to diagnose corrupt JPEG photos.