Return to Digital Photography Articles
Fix your Corrupted JPEG Photos!
Don't worry! Many damaged JPEG photos can actually be fixed!

Corrupt Photos
Have you ever opened a photo on your hard drive, only to find that your JPEG image is now garbled by colors and lines, banding or shifted? ... Worse yet, the photo won't even open and instead reports an error?
Typical Error Messages Indicating Corruption
- No Preview Available - Windows Explorer
- Drawing Failed - Windows Picture & Fax Viewer
- This document may be damaged (the file may be truncated or incomplete) - Photoshop
- Can't read file header! Unknown file format or file not found! - IrfanView
- Could not complete your request because an unknown or invalid JPEG marker type is found - Photoshop
Fixing Corrupt Photos

During the development of JPEGsnoop (a JPEG analysis tool), I began to question whether it was at all possible to fix images that have had errors in the scan segment (JFIF SOS) bitstream. After significant analysis and tool development, I am happy to report that I am now able to correct many of these photos!

Unique Correction Technique!
While there are dozens of software utilities available on the web that advertise that they fix or recover corrupt JPEGs, I am not yet aware of any that actually correct scan bitstream errors (as shown in the samples below). In nearly all cases, these programs will recover the files from deletion (stitching file clusters together) but you may still be left with a damaged JPEG image!
I believe my technique to be unique and hence the reason I decided to post this page and share my services. Photos can often be fixed with virtually no degradation to the original image!
Examples of Repaired Photos
The following shows a few examples of photos that I have successfully recovered. In some cases, as many as 100 errors in the scan segment have been corrected. None of the digital images below had Restart Markers in their bitstreams or misplaced file clusters.
Original Damaged Photo | After Fixing JPEG |
---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
*** Submit your Corrupt Photo for Fixing! ***
Due to the huge demand in repairing damaged photos and the significant time that goes into repairing some of these corrupted images, I am now providing this repair service on an individual quoted basis. Every corrupted photo is different, often requiring new custom techniques to be developed.
Using this process, I have fixed hundreds of photos, including:
- Vacation Photos
- Baby Photos
- Family Photos
- Wedding Photos
Current Status: Closed for new Submissions
At the present time, I have limited spare time available for image repair, so I am no longer accepting new images. Thanks for your understanding.
NOTE: Photos submitted for correction will never be shared or posted publicly! You can rest assured that images are treated as private and confidential.
But the JPEG Thumbnail is OK!
One common misconception people have is that the thumbnail image (that you see in Windows Explorer, for example) is representative of the condition of the actual image data. This is not the case! A JPEG thumbnail mail look perfectly good, but the actual image data could be completely corrupted. That is why you cannot judge whether your files copied OK or are uncorrupted by looking at the preview thumbnail.
Why is this? When your digital camera (or image editor) produces a JPEG file, it creates this in two parts: the first part is your image metadata (EXIF date, time, shooting info, keywords, etc.), which also includes an embedded small thumbnail image. It then creates the second part, the full-size image data, and also stores this into the same file.
JPEG images are almost never corrupted during generation, so both the thumbnail and real image at this point are both fine. However, at some later stage, the file may become damaged (through a copy operation or otherwise), and regions of bytes throughout the file can become erased, overwritten, etc. If this damage occurs to the part of the file that contains the thumbnail, then the thumbnail will be corrupted. If the damage occurs to any of the main image data (scan segment) then the main image will be corrupted. Since the thumbnail section is often less than 2% of the total file size (the rest being the main image data), it is far more likely that the main image will be corrupted but the thumbnail appear fine!

Gray Areas in your Image
In various forums on the internet, people have incorrectly stated that photos are unrecoverable if they contain gray areas. This is not usually true. Some JPEG decoders are very picky with how they recover from errors and simply report Drawing Failed (in Windows Picture and Fax Viewer), while others might draw a middle-gray region or just display a "Red X". In some cases the gray area is in fact completely damaged (overwritten by unrelated data), but this is not always the case.
Why do JPEGs get damaged?
There are many sources of damage to photo files, but the most common reasons are:
|
|
What Happens when you Open / Decode a Corrupted JPEG?
Even a single byte changed in a JPEG file can cause an image to be unrecognizable (or not open at all). Why?
Because of the way JPEG compression is designed, images are stored in tightly-packed streams of binary bits (not bytes). Each pixel can be represented by as few as 2 bits to as many as 26 bits (dictated by the variable-length Huffman Coding scheme). To make matters worse, in an effort to keep the compression as efficient as possible, there is virtually nothing to indicate where you are in the stream of bits (unless Restart Markers are used). Therefore, as soon as a single bit is encountered wrong, the millions of bits that follow will be decoded incorrectly as well. The manner in which DC and AC coefficients are arranged in MCUs means that this corruption often shows up in shearing, wild color shifts and many other visual phenomena.
How can you prevent corrupt JPEG Photos?
One cannot completely eliminate the chances of eventually encountering data corruption within your photos, but there are a few steps you can take that will increase the odds of successfully recovering a photo. For example, let's say that you erased a number of photos from your memory card and wanted to recover them. The likelihood of a successful recovery can be increased by:
- For memory cards, periodically Format the card instead of using single-file delete or delete-all.
- Run a RAM test on your PC whenever you buy/change/upgrade your Memory DIMMs
- Use the Safely Remove Hardware taskbar button when you want to unplug a memory card / card reader if you have been doing anything other than viewing files.
- During USB transfer operations (e.g. copying files from card to hard drive), limit other activities on the PC.
- During CD/DVD burning operatinos (e.g. burning photos to CD/DVD), limit other activities on the PC.
Collectively, these steps will help to: reduce the chance of buffer underruns, bit errors, incomplete transfers and non-contiguous file cluster allocations.
3 users online
Reader's Comments:
Really appreciate all ur help on this. I have three digital cams, though I will keep trying with pics from other cams, as u are correct and there were two cams used with that card.
I just assumed it pulled in order as I took them.
Thanks again!!!
I have followed the instructions and get a working picture, drawing failed, but I can view to print. There's only one problem:
The new picture, the first part copied from working and the second part from the not working, is a copy of the working picture. Is there something I did wrong or is there something more going on with the picture I am trying to restore?
Both pics are landscape from a canon powershot A630 but differnt cards. Does that make a differnce?
Everything looks normal EXCEPT in the nonworking ( DHT error) there are alot of FF in line 99 and AA where as the working they are not there.
I am assuming this is what I am to be changing to match the work pic. Am I correct?
Thanks Again!!
In advance of this feature, here's what you can try doing:
Let me know if you have any difficulties with this, Cal.
Just found this post after several hours of searching. Memory card recieved an error, used a recovery program, pulled 50 jpegs. Very happy to see them of course as they are of a friend's son's 1st birthday party!
Problem: Unviewable, properties shows the same size as saved and saved on disc, but are not pulling up. All pics have a differnt size, reading as all data is there but I can't view or print. Any suggestions?
Think it's great your willing to help out when most people charge for advise and help. Thanks in advance and thanks for having your page out there!!!
Thank you.
Can you please help me to fix seven photos that encountered the problem that you mentioned above. Your help is much appreaciated. Thanks. Let me know how I send you the problematic pictures.
Just wondering if you will be offering your corrupt photo fixing service again.
I have several picture files of my family that I was able to grab from a damaged XD card but I get either a partial picture with a grey bar or an all grey screen in place of my picture. I also have a couple with a thumbnail but no picture.
Please help.
thx in advance,
Stef
I have found a few corrupted jpg's on an ext HD backup. Fortunately I had copied them to DVD as soon as they were loaded onto the PC!
Thank you very much, I'll be waiting when you get back!
I have a laptop that is running Vista. I have a desktop running Windows XP Pro. I have lots of photos from a recent vacation/destination wedding that I downloaded on the laptop and then cut and copied over to the Desktop via my wireless network since the Desktop is backed up. Nearly ALL the photos are "damaged" with the lines like you show on your website. There are also several photos that I looked at through the laptop from the desktop and nearly all of my daughter's last month's worth of baby photos are also damaged. Can these be repaired? Can you recover these? I am very upset about these losses.
I did some reading about this issue and it seems that Vista has some sort of new Jpeg program imbedded in it that is suppose to further compress the jpeg file (Jpeg XR) and it supposedly does NOT play nice with the standard Jpeg programs/readers that everyone is use to. Is this true? Is there a way to convert the photos I have on my laptop in Vista back to the "old" jpeg? I want all my photos in one place, the desktop, where they will be backed up and safe. As I said, a straight transfer via the wireless or a thumb drive or the camera disks does not work as that is how many of my photos became damged in the first place.
Please let me know if you can answer some of my questions or can save my damaged photos. I am devestated and these memories are priceless.
Thank you.
~Cathy
PS. Hope your vacation rocked!
Should I email them to you now or when you get back?
I took these photos when i was on my Youth Exchange trip last December. (Some of them are really precious... :( )
Thanks in Advance!!
As to all, I have a few broken JPGs I need to fix. Couldn't find anysoftware for this job.
Please reply
But vieuwer can't open it. As I read in your guestbook I think you're somekind of magician!
Can you please take a look and see if you can recover my pics.
greets,
Freerk
Can't wait you come back. I have more than 2 hundreds JPG are corrupted from SD card. I have tried various softwares but all failed. I guess you are the only hope. Enjoy your time and we talk again when you come back. Thanks.
Eugene
I recently got back from finland, my girlfriend and i's first holiday together, and in the process of copying files from my girlfriends phone memorycard, the cardreader died and it corrupted 3/4 of the images on it. Is there anything you can do for me once you're back?
I'll not email just yet, I'll wait until i get a reply when you're back after february.
Cheers,
Mark
Filesize: [2489457] Bytes
Start Offset: 0x00000000
NOTE: File did not start with JPEG marker. Consider using [Tools->Img Search Fwd] to locate embedded JPEG.
Please give me a solution
i recently got back from a vaction and my camera was acting up but i had already taken about 160 pictures and could still view them on the camera but when i put them on my computer only about 20 of them worked and the rest wouldnt preview and when i try to open them it just shows a little red x..and now when i put the memory card back in the camera it says it needs to be formatted...i've been trying everything but nothing seems to work...if you have any suggestions it would be greatly appreciated...thanks
My situation occurred when I was copying files from a Vista PC over my network to an XP machine. I received an error during the transfer (can't recall what, exactly), all files not complete at the time of the error are unreadable. I've emailed 2 examples.
The first example is the way the file landed on the XP machine (file name: P1030815.JPG) after the transfer.
The second example is a file that was "recovered" from the Vista machine using Disaster Recovery software. Portions of the file are viewable, portions are not. (file name: UNNAMED_FILE13808.jpeg).
I have about 72 files affected in this manner - thanks for any assistance you can provide.
I lost many photos of my baby due to a window crash where I had to repartition. I was able to recover many using RecoverMyFiles, however most of them came up corrupted. When I use IrfanView to open them, I get a message "Huffman table 0x00 not defined. I tried to use a hex editor to see if I can extract the data part but no go. I think the issue is in the header. Any help would be greatly appreciated.
I am in need of urgent help as I was using my SONY t200 whilst on holiday I took 3- 400 pics setting was on 8 mega pixel, using a SONY 4GB (brought from ebay yes most likely FAKE) I had no issues taking the first 300 picures I did notice a few appear as "file error" on the LCD after viewing it back, so then on checked every image but then after taking the last 50 there was no image in the thumbnail viewer and it was a simple blue background? Once extracted from memory Card all it shows is a JPEG logo and does not draw it, and fails I had used various programmes such as Zero Assumption Recovery and Photo Rescue and some pic up the file that i need and some failed to pic it up at all , but once it did pic it up i can see the image was corrupted and other images where incorporated! Can this be rescued as I really need this image .
PLEASE HELP!
Hoping you will be able to help, as I am just sick over this!
I sent you a few of the pictures to see if they are fixable.
Thank you much for your help and time!
Thanks
I can only speculate that they had been damaged in the process of moving them from one HD to another.
I never thought I would see them again in perfect condition. I hope someday software can be developed to do this that is not so labor-intensive.
Thanks so much for your time, and caring!
Just because the memory card is unreadable, it doesn't mean that your images are gone for good. You may still be able to recover them -- there are many free memory card recovery utilities on the web. Run any one of these on your memory card (it will be especially helpful if it can do low-level JPEG signature detection).
Quite often these utilities work quite well at extracting what appears to be recovered files, but many times these will still be corrupted (unviewable). If you do manage to get the files recovered from the card with such a utility, send me the recovered data and I will see if I can repair the corrupted JPEGs. Also, you can try sending me a couple of the other files from this batch that you currently have on your PC that are unreadable, and I'll see if they suffer from the same problem.
Thanks for fixing my corrupt jpeg! I tried half a dozen tools off the internet and they all gave really poor results. The picture you sent back to me is just like the original. I hope you can create a tool which automates the process so I can fix all my corrupt photos!
Also have to add a thankyou for jpegsnoop, i've been playing and using it to tell what type of camera my friends have and which photo editing software they use.
Keep up the great work!
Steven
Note: Comments on this article have been closed