JPEG-Repair Manual | Mode Selection

<< Back

Currently JPEG-repair Toolkit offers 3 repair modes:

  • Repair – which is JPEG header repair mode, select if JPEG can’t be viewed at all
  • Extract – to extract complete JPEG files from RAW and JPEG photos, select if RAW file can not be viewed
  • Patch – allows you to modify individual bytes in the JPEG bitstream, select if file looks distorted or is cut off (grey area)

Repair (JPEG headers)

Select this mode to attempt repair of JPEG photos that can not be previewed in Windows File Explorer and opened by any photo viewer or editor. It is safe to assume that at least the header of the JPEG file is corrupt.

Windows Photos

For this repair you will need a reference file. A reference file is a JPEG taken with the same camera as the corrupt file. It is also important it was shot using the same settings such as quality, resolution and orientation (portrait/landscape). Copy the reference file to the folder containing the corrupt file(s). Right click the file > Rename > name it ‘sample.jpg’ without the quotation marks.

As the header of a JPEG is only a fraction of the data that makes up a JPEG file, there is a more than fair chance that apart from the header, actual image data is also corrupt. In this case header repair will report an error. It may still be possible to recover data from the file using more advanced repair options (Patch + append option).

 

Extract mode

Extract mode is useful for extracting intact JPEG files from RAW photos such as NEF (Nikon RAW) or CR2 (Canon RAW). It can also be used to extract embedded JPEGs from JPEG files.

RAW files often embed full frame JPEG photos. JPEGs in general only contain small thumbnail previews (if any). It may however be useful to run this mode against photos that were found to be corrupt after file recovery:

For example, this photo is corrupt after it is recovered using Recuva:

Using JPEG-Repair’s extract mode this picture was recovered from it (an entirely different photo) with same resolution as corrupt file (3264 x 1836 – full frame for this camera):

Patch mode

Patch mode allows you to modify, add or remove bytes in/to/from the JPEG bitstream. Visual distortions in an image are often the result of corrupt data in this area of the JPEG. It is by far the largest data section of the file.

JPEG-Repair removes some of this corrupt data automatically if it is in violation of the JPEG specification. After this initial repair, often the entire image will be visible again. Still distorted probably, but no longer cut off half way or so.

Remove Invalid JPEG Marker

After invalid JPEG markers are removed, the entire image will show again. Manual editing is required to clean up remaining corruption.

With time and patience often the corruption can be removed, and the image can be restored to a presentable state again.