Repair Corrupt JPEG Header

Repair Corrupt JPEG Header step by step instructions:

If you haven’t already done so, download JPEG-Repair:



Requires a sample / reference file:

  • The image file must be undamaged.
  • The image file must be created by the same device (camera or mobile phone).
  • The picture must have the same resolution and should have been taken with the same settings.
  • The picture should NOT be edited using a photo editor or similar.

Time needed: 5 minutes.

Repair a corrupt JPEG File Header


Work on copies of the corrupt JPEG photos and not on original media (memory card)

 

  1. Run JPEG-Repair


    Double click “jpgrepair.exe”. There is no setup, just a single executable file.

  2. Select corrupt file(s)


    Select the drive containing the copies of the corrupt photos.
    Browse to the folder containing the copies of the corrupt photos. If you have for example copied them to a folder on your desktop, you typically select the C: drive > Users > Your username > Desktop > and then the Folder.

    Select the JPEGs you need to repair. Drag over them to select. Hold CTRL key to select individual files.




  3. Select Reference file

    Browse to and select reference file




  4. Start Repair process


    Click “Repair”. JPEG-Repair will process all selected files.

    Once finished successfully JPEG-Repair will simply state the number of files that were processed. In case errors occurred it will display a window similar to this:

    Repair Corrupt JPEG Header error log windows

    Common issues are explained here.


This short video shows all the steps to repair a corrupt JPEG header.

JPEG-Repair fails to repair the JPEG, why?

Often a JPEG is beyond repair simply because although it’s extension is JPG it does not contain (enough) JPEG data. The data entropy and byte histogram may be able to tell what’s wrong:

  • Entropy too low/high: The data inside the file is likely not JPEG data or too much JPEG data is missing.
  • Byte histogram looks very different than the one from a healthy JPEG file
Repair Corrupt JPEG Header: good

Healthy JPEG. Good entropy, uniform distribution of bytes. High value for zero is common in JPEG

Repair Corrupt JPEG Header: fail

File filled with pattern(FF). Too low entropy, value 255 (&HFF) maxed out

Repair Corrupt JPEG Header: fail

Nothing but zeros in this file. Value 0 to the max, too low entropy

Repair Corrupt JPEG Header: fail

Does not look like JPEG, text probably, too low entropy, uneven distribution of bytes

Symptoms of a corrupt JPEG Header

A corrupt JPEG header may result in a wide variety of symptoms, however most common is that the file can not be accessed at all:

  • Windows Explorer fails to show thumbnail previews.
  • Windows Image viewer fails to open the file: “Can’t open this picture because the file appears to be damaged, corrupted, or is too large”.
  • Windows Photos fails to open the photo: “It looks like we don’t support this file format”.
  • In some cases the image may look distorted.
Repair Corrupt JPEG Header: Windows photo viewer can't open this picture ..

If the header of a JPEG file is corrupt, you may not be able to open the file at all.

Image distortion caused by corrupt Huffman table

Image distortion caused by corrupt Huffman table