5

I have 100+ corrupt JPEG files. They were all taken from the same camera. Each file is approx 3MB, so there must be plenty of data to work with.

Here is an example of one of the files. (Click here to download as a Zip file)

They are from my uncles camera, so it would mean a lot to him if I could get them fixed.


Here are the steps I have taken.

1. JPegSnoop

This was suggested here. When I use this software, I get the following error message:

Start Offset: 0x00000000
*** Skipped 4878206 marker pad bytes ***
OFFSET: 0x004A6F7E
WARNING: Unknown marker [0xFF00], stopping decode
Use [Img Search Fwd/Rev] to locate other valid embedded JPEGs

I'm not really sure what to do with this error message.

2. Stellar Phoenix JPEG repair

Link

This has got rave reviews online. However, it did not work for me.

3. Online.officerecover.com

Link

This is an online service that again got rave reviews. Unfortunately, the files are too large to upload.

4. Jpeg Repair Shop

Link

This is another highly acclaimed software that did not work for me.

9
  • This question is dangerously close to a request for software recommendations. However, it may be possible there's something that big_smile has overlooked, some way of checking the files to see if repair is actually plausible perhaps? Commented Sep 12, 2015 at 10:22
  • Your example is useless as it doesn't display and there is no possibility to download the broken file.
    – DavidPostill
    Commented Sep 12, 2015 at 12:49
  • 2
    I downloaded your sample file, and it appears to be entirely FF bytes — i.e., there's nothing there to recover.  Have you tried looking at your files with a hex editor, or even Notepad?  I suspect that this is a lost cause. Commented Sep 23, 2015 at 6:16
  • 3
    If the file seems to be a random jumble of a wide assortment of different characters, that indicates that that it has some information.  A valid JPEG file will have the string JFIF near the beginning.  If the entire file (or even large stretches of it) are all the same character, or even if it exhibits anything that looks like a pattern, then it probably doesn't have recoverable image data. Commented Sep 23, 2015 at 16:49
  • 1
    @Scott, Thanks for your help. In notepad, it's the same repeating ÿ symbol, (there's nothing else) so I guess this means that it's beyond hope.
    – big_smile
    Commented Sep 23, 2015 at 17:48

1 Answer 1

2

I have 100+ corrupt JPEG files. They were all taken from the same camera. Each file is approx 3MB, so there must be plenty of data to work with.

This is an often made, incorrect assumption. As far as we know the file may be filled with zeros. So, to anyone reading this in the future:

Spot check some of the files using a hex editor, HxD is free. Verify the files are not filled with zeros of some repeating byte pattern (FF FF FF etc.). I often get sent JPEGs for repair, and I estimate files are zero-filled in at least 50% of cases.

you can not repair this, the jpeg contains no useful data

If this is actually what you see, nothing can repair the files. If it's not the file may be repairable.

this file does contain data!

If and how depends and I'll explain using software I use and wrote, JPEG-Repair to repair JPEGs. If I know of a free tool that can be tried for a certain repair I will mention that too! I will refrain from linking to my own software.

Basically JPEG is a set of sections, some of which we could consider meta data and one, the largest the actual image data. Each section starts with a 'marker' which tells the purpose of the section and it's size. Exception is the section that contains the image data, it's size is not defined, it should be decoded until we reach an end of image marker.

enter image description here

Corrupt or damaged 'header'

Although there may not be officially something that can be called the header, I refer to all section apart from the section containing the actual image data as header. Most likely symptom for a corrupt header is the inability to open the JPEG at all.

enter image description here

Now assume we can not open the JPEG, for example the software tells you "It looks like we don't support this file format". We checked and found the file does contain data, now what can be a next step?

One way to quickly guestimate if the file can be repaired is by looking at 'entropy'. JPEG is high entropy data and we can ask JPEG-Repair to open a file and calculate entropy.

examime file entropy and byte histogram

If entropy looks JPEG like JPEG-Repair will display bits/byte value in green, if too high or low the value will be displayed in red. Byte histogram is fairly evenly distributed and all values are represented. For example following histogram shows only half of possible byte values is used and is by definition not a JPEG file:

Not JPEG like entropy and histogram

We can also open file in batch using for example the extract mode and evaluate multiple files. In this case entropy is too low for the file to contain JPEG data:

We can examine entropy for multiple files

If entropy looks good we can try header repair by borrowing the header of a known intact file that was shot with the same device.

Corruption that extends into image data

enter image description here

This can be result of ransomware but it can happen for a number of other reasons too. An example is incorrectly recovered photos as demonstrated in the video below. Repair requires a known good reference file. In short we glue header onto the corrupt file and then weed corrupt data. Due to how JPEG is encoded we then need to realign the image and correct color.

This video shows an example repair: https://youtu.be/sSDvNa7HOOA

Corruption in image data

enter image description here

Note you can attempt this type of repair using the free JPEG Repair Shop.

There is no real way to repair corrupt data inside the JPEG stream, we can however remove the corrupt data and replace it with dummy data (zeros for example). Rest damage can often be easily repaired using a photo editor that offer content aware fill.

Here's an example repair: https://youtu.be/A33zn_sgm30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .