First things first, what is repair and what is recovery?
Corrupt JPEG file Repair and JPEG File Recovery are often mixed up.
- Recovery: Meaning getting lost or deleted files back from for example a memory card. Maybe the card itself (the file system) is corrupt or the card was accidentally formatted.
- Repair: Repair existing JPEG files that can not be opened in image viewing or image editing software, or that appear to be corrupt when viewing them (colors off, shifted pixels etc.). You can see the file in the Windows Explorer but there is something wrong with the file itself.
For the first you typically use Photo or Digital Image Recovery software. This is a ‘specialized’ software. But you might as well use standard file recovery or undelete software. Photo Recovery tools are often (but not always) either ‘dumbed-down’ generic file recovery tools or RAW scanners.
A JPEG recovery tool scan the drive or it’s file system for lost files. JPEG Repair software scans the internals of the individual corrupt JPEG file instead.
It is confusing that many companies selling recovery software will use terms like ‘recover corrupt JPEG files’, suggesting that their software can somehow fix corrupt files. However, a deleted corrupt file will be just as corrupt after recovering it.
In general (but not always), if you can preview the lost photo in your recovery software, it will be able to recover it intact.
Repairing corrupt JPEG Files
An often heard complaint is that digital photos are corrupt after recovering them using recovery software. This is mostly caused by parts of the file being overwritten, file fragmentation or bad sectors.
But there are plenty of other reasons for corrupt JPEG files. From the moment of taking the picture to the moment the JPEG file is on your PC things can go wrong. Most files I receive for repair were never lost or deleted. They simply became corrupt somewhere, somehow.
First check you can do to determine recoverability.
There is a quick first check you can perform using a hex editor. I use HxD. You basically want to skim through the file and see if there is data in it. Every now and then I get sent files that are filled with zeros or a byte pattern like FF FF FF FF etc.. If that’s the case then there’s no hope of repairing the file.
While there you may want see if the first two bytes in the file are FF D8 and the last two FF D9.
Using JPEG Repair Software
Some time ago ‘Raymond.cc’ discussed a number of JPEG Repair tools. His tests are ‘artificial’ but I can only confirm his results after testing some (Stellar JPEG Repair and HetMan File Repair) of them against real world cases. Specially Stellar’s tool is really spammed around the internet.
Disappointed as I was, HetMan’s tool surprised me being able to repair this image:
Online JPEG File Repair
There are a number of sources online that offer JPEG Repair. Some appear to be automated ‘online applications’:
VG JPEG Repair. They also offer a Windows client. Using the trial I was never able to get a JPEG repaired. The ones I tried appeared to be as corrupt as they were before. The only change was that they were now water-marked. Online it showed 7 more images, all slightly different which suggests it has been trying different solutions.
I also tried the free version of Online PixRecovery and got the same result. The picture marked ‘repaired’ had the same damage as the original.
Bottom line is that in many cases repair of corrupted or damaged JPEGs can not be automated. They require the human eye, intuition and expertise.
I know I have show-cased this image before, but it perfectly illustrates my point: I ran into all kinds of problems I had not seen before. I as a human being can reason my way through that and try alternatives. At this point software can not do that.