JPG-Repair – Fix and Repair corrupt JPEG headers and invalid JPEG markers

JPEG Repair Software – JPEG Repair Tool – Fix and Repair corrupt JPEG headers yourself

Something I have been doing lately is looking into repair of damaged and corrupt JPEG photos. I have been offering a JPEG repair service for a while now. Learning from that I have created a utility that addresses most common issues with corrupt and damaged JPEG files. Creating such a utility has been a long standing wish and I am very happy to finally have such a tool available.

An easy to use alternative for replacing headers with a hex editor

Fix and Repair corrupt and damaged JPEG headers using JPG-Repair. JPG-Repair can repair corrupt JPEG headers using a reference or sample file. It is an easy alternative for replacing a corrupt header with an intact one using a hex editor. A typical symptom of a corrupt header is that the JPEG file can’t be opened at all. Windows explorer does not show preview thumbnails and different viewers and photo editors may show different error messages.

It can also repair Invalid JPEG Markers and other invalid data within the JPEG image bit stream. Typical symptoms are the picture abruptly changing at a grey area, image shift and distorted color bands (see below example).

Although you are ‘editing’ the image, JPG-Repair dos not re-encode the image as a ‘normal’ photo editor would do.

Features:

  • Repair corrupt and damaged JPEG files
  • Fix corrupt JPEG header
  • Repair Invalid JPEG markers
  • Attempts to repair damage due to bad sectors
  • Allows you to improve corrupt JPEG image data by patching the bit stream
  • Does not re-encode JPEG image!
  • Preview of repaired file
  • Free version that shows previews + saves files. Correct preview, then file can be repaired? Limitation of the free version: Batch mode disabled. Please register if you find the software useful.
Automatically repair and fix corrupt and damaged JPEG photos and manually improve errors due to bad sectors and invalid JPEG markers

Automatically repair and fix corrupt and damaged JPEG photos and manually improve errors due to bad sectors and invalid JPEG markers

 

The freeware version of this jpeg repair software is functional but batch mode is disabled.

This download is free of adware and other crapware!

 
 

Reference File

The reference or sample file should be taken with the same camera as the corrupt image(s). Also, the settings (resolution, quality and orientation) of the sample file need to match the corrupt files. If unknown then you would need to experiment by taking different shots with different settings using the original camera (same brand and type).

 

Windows photo viewer doesn’t like this file! The result of a corrupt JPEG header.

Fix and Repair corrupt JPEG headers

I suggest, I urge you to work on copies of the corrupt files!

Repair guides for fixing corrupt JPEGs:

Category 1, corrupt JPEG Header:

The first type of errors in corrupt JPEG files is corrupt headers. Typically you will observe the following symptoms:

  • No thumbnail previews.
  • Error messages when opening the files. Windows Photo Viewer will state the file appears to be damaged, corrupted or is too large. Windows Photos will tell it looks like we don’t support this file format.

Instructions to repair JPEG files that will not open.

Category 2, Invalid markers and errors in JPEG bit stream:

In this case the image file actually opens, but the picture looks distorted:

  • Only part of image is displayed, bottom half is grey.
  • Image shifts.
  • Colors ‘shift’.
  • Image viewer/editor complains about invalid jpeg marker.
  • Image briefly appears intact, then image disappears or corrupt image shows. This is typically the case when the embedded preview JPEG is still intact.

Instructions to correct image shift and color errors.

We did Raymond.cc’s challenge: repair-and-fix-corrupted-images

Raymond.cc’s challenge: repair-and-fix-corrupted-images. We win!

JPGRepair against the competition using the Raymond.cc test method and images! Click image to read the blog-post. For one, this test shows how hard automatic JPEG repair actually is.

It doesn’t work!

* Files remain corrupt (can not be opened)

Then JPGRepair was unable to find actual image data within the corrupt files. A very common cause for this to happen is that although the file has a > 0KB file size and a JPG extension, it is actually empty.

To check: Use a hex editor such as HxD to open the file. Commonly, empty files contain only zeros or a FF FF FF byte pattern. Such files can not be repaired at all.

Check corrupt JPEG files using HxD. This corrupt JPEG is beyond repair.

Check corrupt JPEG files using HxD. This corrupt JPEG is beyond repair.

It is also possible the damage corrupted the header + part of the image data (like part of file was overwritten). As such it is impossible for JPGRepair where the actual image data starts (SOS marker) and it can not merge an intact header with the image data.

* Files look totally weird or psychedelic now

Possibly your are not using the correct header (wrong resolution for example)

Wrong JPEG header chosen for this file ..

Wrong JPEG header chosen for this file ..

* File properties are lost

Part of the header of a JPEG may include info about the photo, like camera model, settings, flash fires yes/no etc.. JPGRepair strips non essential parts from the header of the sample file and therefor such info may indeed be lost.

Certain details that were present (properties of photo, camera make and model etc. will be lost in repaired JPEGs.

Certain information that was present (properties of photo, camera make and model, thumbnail, preview etc. will be lost in repaired JPEGs. This does not affect the quality of the image though.

I get a SmartScreen warning when running JPGRepair

See this when running JPGRepair? It means I have recently updated the software and SmartScreen doesn’t recognize it yet. Click More info > Run anyway.

Credits

The idea for this tool is not original and basic concept was ‘copied’ from Wim Vanmaele’s utility repair-jpeg. I can’t find the original source for this program but it can still be found here: http://directory.s2services.com/jpg-bmp.htm.

Support

If you have other issues then feel free to contact me. Send me your sample file + some corrupt files so I can examine them.

17 thoughts on “JPG-Repair – Fix and Repair corrupt JPEG headers and invalid JPEG markers

  1. stofa

    Hi,

    i have a question, i have maybe the problem with wrong header of sample, how could i find, that i have correct one or how could i change to correct one?

    Thanks for answer

    Reply
  2. katy

    hola . reparas tambien archivos word ?? . mi disco duro se encuentra en fase de recuperacion de informacion.. y algunos archivos quedaran corruptos. para cuando un disco se encuentra en labotorio con especialistas en recuperacion de informacion es decir que reemplazan partes mecanicas del disco. que programas recomiendas para extraer informacion de ese disco ? . no conozco los que usan pero tener una referencia de su parte me interesa. Gracias

    Reply
  3. Dexter Fernandes

    Hi, I just tried the trial version and i used 1 file in the same series which was a sample and the very next one was corroupt, it just gives me an error saying : “An error occurred while processing this image”

    The properties of this jepg file are missing but it has a jepg file size of around 6MB

    Reply
  4. zanet

    hello,i tried recover photos by this program and many others with no result

    Reply
    1. Joep Post author

      Hello,

      That is possible. A good part of the files that people send to me are beyond repair. If that’s the case with your files or not I can not tell without looking at them. So feel free to send a few + a known good sample shot with the same camera and settings (joep@disktuna.com).

      Reply
  5. wiljun liston

    i emailed you some files. pls check if you can still recover it.. emailed @ (joep@disktuna.com)

    Reply
      1. Joep Post author

        Okay .. Can you give me access to the entire google drive folder please so that I do not have to download files one by one?

        Reply
  6. Kathleen Donlon-Miller

    Hello. I just downloaded this program in hopes of repairing some jpgs that I recently payed someone a lot of money to recover from a damaged external hard drive only to now find most of the files are now corrupted for some reason. I feel like crying. Anyway, I feel dumb asking but how do i provide a sample? I have an uncorrupted sample taken by the same camera with same resolution and quality and orientation. Luckily there are a few that were not corrupted. These are files taken years ago and I no longer have the camera. Thanks for any help you can give.

    Reply
    1. Kathy

      Actually I think I figured out how to add the sample photo and then the corrupt one but nothing has happened to any corrupt file I have tried. I only tried a couple.

      Reply
      1. Joep Post author

        Can you send me those + a sample so I can check if they’re fixable at all?

        Reply
  7. Abraham Simpa

    Hello I sent a sample of a corrupt image file to your address. Pls check for. Me if I can recover this. It’s really urgent pls. I’d appreciate your response. Thanks.

    Reply
    1. Joep Post author

      Hello,
      You sent me .NEF files and a .JPG sample. So did you intend to sent me JPEGs? The NEF files only contain zeros, so no data at all I’m afraid.

      Reply

Leave a Reply

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