JPEG-Repair Manual | Types of JPEG corruption

<< Back

Repairing photos with JPEG-Repair Toolkit

Repair JPEGs: Select a tool > Select file(s) > Click Repair

Repair JPEGs: Select a tool > Select file(s) > Click Repair

Please do not let the different buttons and options intimidate you. For most simple repairs you only need the section on the left the window. In general JPEG corruption is one of two (or both): A corrupt header or bit corruption in the actual image data. You either see no picture or you do see a picture even when it is distorted one way or the other. Typically the first photo is what you get when the header is corrupt. In the second example, the image actually can be opened but ‘distorts’ at some point due to bit errors in the JPEG data.

Corrupted header:

Typical case of a corrupt header: Windows can not show a preview.

Typical case of a corrupt header: Windows File Explorer can not show a preview.

Image distortion caused by corrupt Huffman table in JPEG file

Image distortion caused by corrupt Huffman table in JPEG file

Symptoms:

  • No preview in the Windows File Explorer
  • No image in Photo Viewers
  • Error message: Invalid JPEG Marker
  • Windows Photos: It looks like we don’t support this file format
  • Old Windows Photo Viewer: File appears to be damaged, corrupted or is too large
  • Distorted image

Possible repairs:

  1. If JPEG: Try repair using a reference file
  2. If JPEG: Try Extracting JPEG data
  3. If RAW: Use Extract to recover JPEG data

Corrupted JPEG image data:

Corrupted data in JPEG bitstream can cause various distortions in the image

Corrupted data in JPEG bitstream can cause various distortions in the image

Symptoms:

  • Image displays only partially
  • Color errors. From the point of corruption, color in all image data following is ‘off’.
  • ‘Shift’ in image, image data not aligned
  • Grey ‘box’, mostly at lower part of image. Image starts normal and appears cut off.
  • The cut off part of often grey but can be any solid color.
  • Invalid JPEG Marker error messages issues by an image viewer or photo editor.

Possible repairs:

  1. Use Patch mode to remove invalid JPEG markers
  2. Use editor (Patch mode) to remove corrupted bytes
  3. Use editor to re-align shifted image data

Important:

Often photos repaired using this method require post processing using a photo editor. Removing corrupted data from the photo causes image shift. To counter that zero bytes are added to replace removed data. This leaves greyish lines. 

If you do not have a photo editor I recommend Paint.NET as it is easy to use even for beginners. The tool most suited to remove grey lines is the photo stamp tool.

large part at bottom of photo is grey

Grey line is a result of adding zero bytes to replace corrupted data.

Grey lines that were side effect of repair removed using clone stamping