Tuesday, February 12, 2013

Fix corrupted JPEGs made by the Samsung Galaxy S2

While organizing some of the pictures I took with my Samsung Galaxy S2, I've encountered one file that couldn't be opened. Being a nerd, I couldn't resist and had to investigate the issue. I think I've already spent more than two hours searching the not-so-all-knowing internet for solutions, but in the end it came down to using my brain and reading the EXIF specification (PDF).

tl;dr: The Samsung Galaxy S2 can occasionally create corrupted JPEGs, i.e., files that don't follow the specifications.

The Problem

Standard (linux) picture viewer applications would just say that they can't open the file. That's obviously not sufficient to get to the bottom of this, so I used GIMP and ImageMagicks convert, which both gave me the same information:
$ convert test.jpg out.jpg
convert: Corrupt JPEG data: 1072 extraneous bytes before marker 0xd8 `test.jpg' @ warning/jpeg.c/EmitMessage/231.
convert: Invalid JPEG file structure: two SOI markers `test.jpg' @ error/jpeg.c/EmitMessage/236.
convert: missing an image filename `out.jpg' @ error/convert.c/ConvertImageCommand/3011.
So, the two valuable information were:
1072 extraneous bytes before marker 0xd8
two SOI markers

The EXIF standard

The only helpful googling those error messages brought up was to use a hex editor. (Yeay!)
My corrupt file starts with
FF D8 FF E1  00 0E 45 78  69 66 00 00  49 49 2A 00 ...
What you see here, is a JPEG file (FF D8) followed by some EXIF information (FF E1). Using the EXIF specification (PDF), we learn that marks the start of an application segment 1 (APP1).
Offset (Hex)NameCode (Hex)
0000SOI (Start Of Image) MarkerFFD8
0002APP1 MarkerFFE1
0004APP1 Lengthxxxx
0006Identifier4578 6966 00 ("Exif"00)
000CAPP1 Body
Okay, so FFD8 is a SOI marker and the error message says that the file has two of them, which apparently is a bad thing. So I searched for another occurence of FFD8 and found one at 0x442 = 1090. It also said that it had 1072 extraneous bytes before marker 0xd8, which is only slightly smaller than the area between the APP1 header and the next SOI marker. So, is the SOI marker here wrong?

A valid JPEG file

Since I don't have the slightest idea of what exactly is wrong here, I opened another JPEG that works and was taken only minutes before the corrupt one. Comparing them by fast-switching between the console tabs (exploiting low-level visual processing and attention guidance of the brain is fun), I've noticed two things:
  1. FFD8 can be found at the same position in both files, so that is not the problem.
  2. The first difference is in the APP1 length.
  3. The difference is huge!
See for yourselves:

Corrupt file:
FF D8 FF E1  00 0E 45 78  69 66 00 00  49 49 2A 00 ...
Valid file:
FF D8 FF E1  E0 42 45 78  69 66 00 00  49 49 2A 00 ...
The length of the APP1 segment in the corrupt file is only 0xE = 14? That should be far too small.

I then started to increase the length in the corrupted file randomly and see what error messages convert would give me, but that's more like being in a completely dark room with a metal bucket and throwing rocks until I hear that I've hit the bucket.
But let's see what is at the end of the APP1 segment in the valid file:
0xE042: FD CF FF D9 FF DB 00 84
At 0xE044, which is 0xE042 plus the SOI marker before the APP1 segment, it says FFD9 and the EXIF specification tells us that this is the EOI (End Of Image) marker followed by FFDB, which is the DQT (Define Quantization Table) marker, see Table 40 of the specification. As far as I can tell, everything is where it should be.


Now back in the corrupt file, I searched for FFD9FFDB and found it at 0x10010. Do you see it already?
Minus the two bytes for the SOI marker, the length of the APP1 segment should be 0x1000E, which unfortunately can't be stored in only two bytes. What CAN be stored in two bytes is the lower part, 0x000E, which we see as length in the APP1 segment header. A classic example of an integer overflow, the first one I've observed in the wild!

The EXIF specification is clear:
Interoperability, APP1 consists of the APP1 marker, Exif identifier code, and the attribute information itself. The size of APP1 including all these elements shall not exceed the 64 Kbytes specified in the JPEG standard.


From my understanding, the APP1 segment contains the thumbnail at the end. I reckon that that can be recalculated and stored properly by most image processing applications, so let's try shorting the data there to get under 64 Kbytes. I removed 20 bytes directly before the FFD9FFDB, which yields a new APP1 segement length of 0x1000E - 0x14 = 0xFFFA, and store this new length at 0x0004.

It seems like this works! The JPEG can now be opened again without any errors, not even regarding the thumbnail, which I've truncated and is not so important to me.

This is the only time I've encountered this problem with pictures taken using my Samsung Galaxy S2, so this should be a one-time fix. If it happens again, I think I have write a little script to do that for me.


  1. Awesome man! You helped me recover an important photo for my girlfriend :-D

    1. You're welcome! I'm glad that this helped not only me ;)

  2. Would you be able to translate to english for those of us who aren't well acquainted with tech savvy language? lol thanks.

    1. How about all of it, that would likely not do it?

      I follow the sequence of alpha numeric figures that id the jpeg file.

      Are you just correcting the corrupt one to closely match a prior good filed jpeg?

      IDK, but what I do is after first getting my s2 I went on a road trip Boise through Yousmite and home.
      Stopping at a pow wow in Nevada, taking some video and pictures, same once I rode through the lodge area in Sierra Nevada's.

      Every vid. & pix came out fine only to later vanish?



  3. This comment has been removed by a blog administrator.

  4. I have a similar problem with my samsung galaxy s2. I took pictures at a wedding only yesterday and the thumbnails and image are just a grey square with a lightning bolt shape going through. I copied them to the computer but it says on there that they are corrupted nd cant be opened...its such a shame...i only have 3 randim photos taken on my phone from yesterday that works! What would you recommend i do? Any help would be much appreciated. The pictures are obviously special to me and im gutted :(

    1. How many pictures are we talking about? The problem I described here seems to occur only sporadically, so I fear that you might have a different problem.
      I'd also offer you my help, but since they are personal pictures I don't know if you'd want other people to see them. If you're okay with it, you could send me one of the corrupted files and I'd give it a shot.

    2. Thats very kind...there are probably just under 100 of them. I probably wouldnt send them as i cant garantee i wouldnt be sending one with ones in the picture who wouldnt appreciate me sending them out to a stranger...although im having difficulty emailing one to myself. I think because my phone is saying it is corrupt it wont actually attatch it to a email. Not really sure what to about it to be honest!

    3. I can understand your concerns, it would be the same for me.
      The first thing you should do is try to get your pictures on a computer, maybe via USB. And then you should make a backup, just in case.
      If you try to open one of the pictures, you have to write down exactly what the error message says. Linux programs are usually a bit more verbose about what the problem is. With this information you should be able to investigate more or come back here.
      Other than that, there is nothing much I can do to help, I fear ...

  5. Any way you can post a video of this process? I have all same issues

    1. A video seems like a good idea, but I'm not a good speaker. It would also take quite some time to make it good. But there are so many other people now with similar issues that I think I'll write a small tool to apply the fix automatically.

  6. My friend said he has 20/30 pics that are corrupted on his samsung and he would love to get them fixed

    1. I think the demand for a small tool has just increased enough for me to write it. Stay tuned, I'll publish it here on this blog in the next month.

  7. I have 1 corrupt picture, would you be able to take look at itfor me? its the one picture out of thousands that I wanted to have printed and framed :(

    1. Sure, if you're okay with me seeing it. If you send it to me, I'll do the best I can and keep it private.

      Or, if you can wait a few weeks, I'll have a tool posted in this blog to automatically fix it.

    2. My video files are vanishing!

      I got this phone 4 months ago and captured video of a pow wow and the Sierra Nevada mtns and well about all my video including recent is gone?

      have you heard of that happening this a Samsung thing? im looking for that link?

      thanks David@

  8. Hi there i am having the same problem pics that i once could open and view i now can't have alot so trying to sort out each one would be a lenghty prosess and could take me a very long time so if you could do a program to sort this as i have family pics and birthday pics i would like to see and print off

  9. Thank you, I would look forward to such a tool. I'm having the same problem with my pictures and would like to recover them.

  10. Hi! Are you still on this tool? I've got one picture i'd like to try to recover, since is pretty much all i have of a special person, yet I don't really want to ask you to waste your time fixing just one image!

    1. Yes, it is still on my to-do list, I just have to finally do it ;)
      BTW: Have you tried some of the freeware JPEG repair programs? It occured to me that I've never tested them on my broken image.
      Some people have sent me their broken pictures, but they all had completely different problems than the one I described in this article.

    2. Yes i tried every freeware JPG repair software i could find, around 10 of them, but none of them can repair the image. They all show me that the image is corrupt, half of them can't find any data to repair, the other half just said everything is fine or they repaired it succesfully but the file stood corrupted! :(

  11. Hi, i have some very important work related pictures. i took them through an app called "date camera" its an app the puts a date and time stamp on your pics. It usually works fine but on one of my big projects i did a few days ago its showing all my pics as a black screen with a grey box and a lightning bolt going thru it. I really need this problem solved asap as i am going to fail a project.. Please help somehow!!!
    thank you, greeatly appreciated!

    1. Hi!
      I do understand the urgency of your situation, but please understand that I am NO EXPERT regarding photos or image formats and that my article and solution only apply to a very specific problem that occured when using the Samsung Galaxy S2.
      The way you describe your problem sounds like it is something completely different and I or the tool I'm going to write will not be able to help you. Sorry.

    2. hay im with you, i think this is a s2 Samsung problem and they should have a fix.

      but im not getting any results with trying to communicate with them.

      how much cash money, or what's your pleasure video games etc i have vintage items to part with?

      thanks David

  12. Hi,
    I also have corrupt images however after viewing the hex of the files I haven't got the SOI marker of FFD8.

    Can I do anything about this, I do have the EOI marker however of FFD9.
    any help would be much appreciated

  13. I have an idea try Kernel for Digital media recovery software to recover all over images, videos and digital items from memory card and hard drive. Visit for more details : http://www.freedatarecoverysoftware.org/digital-photo-recovery.html

    1. The software isn't free and this looks suspiciously like spam. Can you provide more information why I shouldn't remove this comment? Like what it can do and why it is worth the money?

  14. My Samsung s4 has started doing the same thing with the pictures. Is there a way to not only recover the pictures but stop it from happening. I am not a technical person and have no idea what all that hexing and Edd8 and all that stuff means. Are you still thinking about making a program that fixes this problem?

    1. I have no idea what causes this. It only happened to my one or two times with the S2, so I really can't tell. You should contact Samsung for that.

      But I made progress with the tool I wanted to write. But, as always, it is harder than I thought. It is not that easy to even only detect a corrupt image with the problem described above.

    2. Hi Florian,
      I have had this problem today - I took a number of photos, all of which turned out fine, except the very last 3 which show a grey box with a silhouette and a tear through it.I know at least one of the three is a good one that I would love to print, can't remember what the others were but would love to see them. I have no problem sending them to you, providing I'm not being very cheeky in asking you to take a look at them?!

    3. It is a bit cheeky ;)

      I think this is slowly but surely getting out of hand with people coming to me with every possible problem with JPEGs. I was only covering one specific problem and that is unfortunately how far my knowledge with JPEGs goes.

      But having a severe case of helper's syndrome, I'd take a look at it, but not promising anything.

  15. Hi Florian,
    I have recently been trying to repair corrupted images after recovering them following an accidental deletion. While I know this is not the same issue as the one being discussed in your blog you seem to be very knowledgeable in this subject and I have as of yet been completely unsuccessful in determining a method of repairing these files. No freeware JPG repair software I have attempted to use can even open these files. The images in question are extremely important to my wife and I was hoping you wouldn't mind taking a look at one of them and maybe helping point me in the right direction towards fixing the rest of them. I would truly be eternally grateful for any and all assistance you would be willing to give.

    1. Well, thank you for putting your trust in me, but I am not that knowledgeable with image formats. I just like challenges and that's why I tried to understand how JPEG works.

      That being said, I doubt I can be of any help with your photos, but I'd try. But please check beforehand that there actually is anything to recover, because one guy send me files with size zero and one with files that were only 2 MB of zeros.

      Maybe I'll take that as a reason to have my tool report anything in the file that looks like JPEG, so one can easier decide whether it can be salvaged.

    2. I have spent the last three days attempting to recover these files and have only recently recovered them and am now trying to understand how to repair them but as of yet have been unsuccessful. Most of the files I have been able to recover range from 1 to 3 MB in size is this a normal size for this type of file? I would rather not waste your time by sending you something that is not repairable.

  16. Hi I have just suddenly had several pictures become broken on my S2 and after rebooting it lost around 10 pictures. I had also tried freeing up space. A recovery app would be most welcome.

    1. If the files are just gone, then that is completely different problem. But if the files are corrupt, you could give the tool Cosimo posted here a try.

  17. Hey people. First off, I'd like to thank Florian for this article... pretty insightful for me. Now, my issue was that random photos in my SII would be readble at first and suddenly one day appeared grey in the galery and wouldnt load, or had partial grey columns which made the photos unrecognizable by some apps. Today i wanted to share a pic i took on friday, which i was able to see yestarday, but today it was partially greyed as well as some other pics. I tried to convert them on my computer (Fedora 18) and it would give me no isuue with the ones partially greyed, but the completely grey ones gave me several error messages. Funny thing is that I reomved the SD card from the phone, plugged it in again, and then the card needed to be reformated... huge bummer. The "greying" problem happens with both images from the internal and external sd, but most of the time its with the external sd.
    So, what i really wanted is to recommend this software: PhotoRec (http://www.cgsecurity.org/wiki). I don work for these guys nor anything similar... just a happy new user of the software. I usually just reformated the darn SD lossing all it had, but this time i had photos i really didnt want to loose and found this tools which recovered them pretty well, including images and files i thouhght didnt exist anymore. Just make sure to follow the documentation from the website.
    On a side note, wtf is it with these phones and this bug?? I remember once reading a solution given by samsung being to clear all cache and stoping some apps to rebuild cache, but i lost the link and havent been able to find it again. Point is, they know this happens, and they know its due to one or several of the core apps in the phone... its unbelieveblae to hear it happens in the S 4 as well.

    1. Thanks, I'm glad that I can help in some ways ;)
      I haven't had corrupt photos since that one incident, so maybe it was a one-time fluke and they fixed it now.

      Also, thanks for the tip with the PhotoRec software. I still find it hard to imagine that no existing recovery software can fix this particular problem I've described. Next time I have corrupt photos, I'll give it a try.

      On a side note: I'm quite busy right now and only half-finished with the tool. It is, of course, more complicated than I thought, because JPEGs can be formated in so many different ways that it is not so easy to ensure I don't break any valid files.

  18. Hi. Where do I edit it? Can I edit it via my Samsung S2?

    1. Maybe there is an app for that, but the easiest way is to download it to your computer and edit it there.

  19. Thanks Florian, you helped me too!
    Yesterday I found on my phone a corrupted picture of my two years old daughter (the most beautiful photo taken that day, obviously ^__^) . In the gallery it looks nice but no way to open it with any app, nor with PC softwares.
    But with your post, the EXIF specification, pen, paper and a good hex editor the picture came back!
    The phone is a Samsung S4 (GT-9505).

    The only problem is with EXIF data.
    I can't read EXIF data with most of the software used. I tried with Preview, Gimp, Xee, XnviewMP (it uses exiftool 8.43) and more and I can see only some metadata (dimension, DPI, …).
    I 'm running on OSX but I tried also Irfanview (with Wine) and imageMagick display).
    But exiftool seems to work...
    If I open the image with ExifTool (better, pyexiftoolgui, at 3 Am after reading the whole Exif Specification I was not able to take a look at CLI- tool's man page...) I see all EXIF data (with the correct date, time etc) but I read:
    [minor] Unknown garbage at start of EXIF segment.

    I'll do some experiments of writing metadata to the file. I think I'll must come back to the ol' good command line. :-)

  20. This comment has been removed by the author.

  21. Hi Florian,

    Recently my samsung S2 has produced a number of corrupted pictures, and the situation is usually like this: as soon as I have taken the photo, I can view it, but after several hours or days, it will become corrupted. With a Hex editor I can see that most of the files are not blank, but in one of the file about 90% of its contents are "00"s...

    So I gave up the picture with lots of "00"s. For the other pictures, using the ImageMagicks convert tool, I got different error messages like
    "convert.exe: Corrupt JPEG data: found marker 0xc8 instead of RST0 `201362~2.JPG' @ warning/jpeg.c/JPEGWarningHandler/349."
    When I view this picture in my computer, I can see about 1/4 of the original picture and the other 3/4 was grey in color. Is it a problem of my phone or otherwise? I am glad to provide you with the picture if you are free to take a look at it for me :)

  22. I bought the WB31F SAMSUNG Digital camera. I shot some photos and i trasfered them in my computer through cable.
    Then i formated the memory of the camera.I changed the orientation of some photos on pc and I tried to put them again on camera by cable.
    Finally the thumbnails of the prosessed photos are ok but on screen of camera i get the message "file error".
    What can I do to see them again on my camera's screen.

  23. SO how do you actually do this? in simple terms please :)

    1. I'll try:
      - Search for the code that marks the start of the image (SOI marker)
      - You should find two, one for the thumbnail and one for the actual image
      - Write down the position of the SOI of the actual image
      - Calculate the size of the APP1 block
      - In this case it will be more than 2^16 and start from 0 again (think of it like the Y2K bug)
      - Shorten the APP1 block by deleting some bytes from the end to make the size fall under 2^16 bytes
      - Update the APP1 length field accordingly
      - Save file

      Does that help?

    2. Sorry to bug but the above doesn't help. I'm getting image after image corrupting at random, did you ever complete your promised tool as I'm lost in the jargon (it's an age thing)?

      I think you really would have to spell it out for me literally.

      How exaclty do you 'calculate the size of the APP1 block'?
      Is the fisrt SOI marker the thumbnail?

      have you got a copy of the Exif spec as the link at the top does not work?

      hope you can help a desperate man here!

    3. The tool is about half finished. Right now it's only Java source code, but if you feel like it, you can try to run it. It will scan the file and report which markers are found and some information about the segment lengths. (It's only one file, compiling should not be a problem.)

      To your questions:
      - Yes, the first SOI marker is the thumbnail
      - The size of the APP1 block is the number of bytes from the APP1 marker until the EOI marker right before the next SOI marker, inclusive.

      - You're right, the whole exif.org website is down. Here is another place to find a description of it: http://www.media.mit.edu/pia/Research/deepview/exif.html

      I hope that helps. If not, keep bugging me ;)

    4. Hi Florian, thanks for the above just having a slight problem compiling however!
      Here's the message:

      Exception in thread "main" java.lang.NoClassDefFoundError: JpegHeaderFi
      g name: de/thesentry/jpegheadefixer/JpegHeaderFixer)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

      Once compiled I take it the usage is as it says in the code?


    5. How did you compile it? Eclipse? Netbeans? Or from command line?

  24. This comment has been removed by a blog administrator.

    1. Thanks for the praise, but please do not post ads or similar links.

  25. Hi there, Florian

    I got several problems like that. I need to fix the photo files for a client, I Tried you java class but it doenst generate the output (fixed) file, seens like you didnt implemented that. How can i help you with that? Did you finish it?
    It would be great if tha java class works for fixing the files, so i could write a program to fix all corrupted files.


    1. The tool is far from finished, yet. I'm a bit busy now and don't know when I can work on it again. But please be aware that this tool is only trying to fix one specific problem. Chances are high your images are corrupt for a different reason and you'll have more luck trying another fixing tool.

  26. Hi there Florian. You have provided so much useful information and I do not know how to fix my pics. I have 5-10 photos from our very first business event that we had today for the 4th of July and of course one is definitely the most important. Is there any way that you can help me out? Thank you so much! Heather

    1. Sorry for copy pasting, but busy and all, so:
      The tool is far from finished, yet. I'm a bit busy now and don't know when I can work on it again. But please be aware that this tool is only trying to fix one specific problem. Chances are high your images are corrupt for a different reason and you'll have more luck trying another fixing tool.

  27. hi Florian, thanks for all the awesome posts!! It makes me wish I spoke Java.I was able to fix one of my pictures using ZAR, but I still have 5 the just won't work. Has anyone else gotten Florian's program to work? Would it be possible for me to email someone the last few pictures? I would really appreciate it. Thanks Melinda

    1. As I said on already, I'm only trying to fix this one specific problem. Many people sent me their photos so I could try to fix them, but until know none of them were corrupted because of the issue I had and the one I'm trying to fix with this tool. I hope I'll have some time to work on the tool in the near future, though.

  28. Hello, I have been busy the last few months learning the Jpeg header and file format. Looks like our kindly author has a lot on his plate. If its okay I'd like to offer my help. I've been having great success in repair if you would let me help: eric@codecancare.com to see if I can recover the data and learn at the same time :)

  29. Thanks for the information.Please share this information in video form so that we can use this valuable information easily.

  30. Mr Florian, Can you fix NTFS encrypted jpgs i lose my backup .pfx and re-install Win

    1. This is not really my topic, but maybe you find something useful here: http://security.stackexchange.com/questions/8307/how-secure-is-ntfs-encryption

  31. Mr. Florian,
    I am so impressed by your clever technique and your kind willingness to help people. Recently, I traveled to Rome with my wife and took a lot of pictures using my Galaxy S5. Unfortunately, the most beautiful pictures took in Villa d’Este have been corrupted. I do not want to lose them since they are precious to us (although they are mostly sceneries and nothing personal). I have been searching techniques for recovering the pictures for quite while and found your technique is the most promising. However, I am not a computer guy and I am afraid that I am not able to follow your technique well. I am willing to learn Could you advise me some basic should I start with?
    Thank you,
    De Yu

    1. Hi De Ye,
      the best I can do is to advise you to find some (free) image recovery software. Like I said here before, I only fixed one specific error in the JPEG header and my knowledge of image formats only goes so far. I'm afraid I'll most likely can't help you with your pictures.
      I hope you can recover them somehow.

  32. Hi Florian, and congratulations on finding soooo much out about this growing problem.

    I've been seeing this myself for about 3 years now, and the 'curse' is getting worse lol - but not just for me, it's affecting more and more hardware, but generally cell phones, tablets with cameras, and digital cameras.

    As a side note to possibly help others, I have been using freeware recovery software simply named TESDISK and PHOTOREC, both found on the www.cgisecurity.org website. These are made by Christophe Grenier and a collection of other great programmers on an open source project to recover 'any' kind of damaged files. The 2 programs mentioned do slightly different things, one being DOS based and the other being Windows 32/64 based instead, the results are impressive on both, though the DOS version is more technical & has more options (it can run in a DOS Window too).

    I've yet to go through your examples here to see what I can find out, but I've been a programmer in various languages for a long time, and it all makes sense :-D It's just a case of finding the time to sit down without interruption here and try things out.

    Here's some things I think may be part of the initial problem. Firstly, I've never found this to happen on older hardware - as far as I can find, it's only on high speed memory cards, so only 4Gb and above will get the problem (please correct me anybody who's found this to be different - it's important to know it this is partly to do with larger capacity memories only I think).

    Second, once files are shown as grey - Don't use the card again till you've tried recovery software. Any attempt to write anything to the card/hardware can damage the data even more. If possible, write-protect the actual card or device (some cameras have a 'read-only' option hidden in the settings).

    Third: This can happen at any time. The files can be fine for 2 seconds, an hour, a week, a month or more - then you go into your gallery (on android devices), or file manager in Windows etc., and some files cannot be opened (in windows), or appear as grey squares (on android devices). On photos which only half appear, I assume this is when the file crosses a block/sector boundry, and the information is only correct for part of the file.

    Extra bit I need to add - As well as not using the memory card, or taking photos to internal memory if its a phone/camera, try to avoid using any device to view thumbnails....so in Windows turn off Thumbnails View, and on Android devices avoid going into the Gallery.
    I suggest this because as Florian has shown, the thumbnails are part of the actual file information, and all it takes is your software/device to access a file, and it can become corrupted, even if it's only viewing the thumbnails.

    Could it just be a software glitch? Or maybe a timing error in writing the data? Because it seems that the original file is all still there and perfect, including EXIF and thumbnail details, I am thinking this is just a bad programming error that hasn't been noticed because it's too strange. Another odd point is, this only seems to affect photo & video files. I don't keep hearing of corrupted EXE and DLL files, which would again indicate a possibly industry-wide error in software finalising/viewing JPG and video files.

    Okay, that's enough from me for now, I'll drop back in again to see if anything new has been added soon.

    Thanks again Florian, and to everybody else who's added information here.

  33. Thanx it helped me a lot but only the half grey color problem is still there and i had extracted thumbnail very clearly nice tutorial thanks again

  34. Thank you so so much for sharing this information!! I used your guide and it was absolutely helpful for me :)) Thanks a lot for the detailed explanation. I managed to recover my birthday photos:)) I also like this resource and maybe you will like it, too. I hope it will be useful and helpful for you :)) https://hetmanrecovery.com/file_repair/software-2.htm

  35. Nice article, thanks dear author and i hope this will help us.

    The user can use the JPEG Recovery Software to recover lost images from the digital camera.

    1. Usually, I would delete links, but since I never delivered on my promise to make a tool out of my findings, I hope the linked software can make some people happy ;)

  36. We occasionally run into this error with images batch-resized using ImageMagick, and are still looking for a solution to 'fix' these images. It only happens sporadically. I've also tried several freeware JPG recovery software products, but with no luck. I am intrigued by the manual HEX editing method described here, however, so I guess I'll have to try to figure out how to do it.