Land of the lost pictures



  • I recently noticed that some of the pictures taken with my phone somehow get corrupted: they're good when I take them (well, good as in "can be viewed" not in "are nice pictures"...), but then sometimes, randomly, some of them get corrupted and can't be read any more. So I plug the SD card in Windows and it tells me the card FS is borken, and after a couple of back and forth and try again, I get the same thing.

    So, OK, the SD card is dead, no big deal, I get a new one and all is fine (well except that I'm TRWTF and got the cheapest one which is class 4 and not 10 so my phone complains it's too slow, but that's not the issue here).

    Now, I've got some pictures on my old SD card that are corrupted. They're not important in any way (otherwise they wouldn't be just on my phone!), but since I've got the files, well, it would be nice if I could recover them. Do any of you know of a good file recovery tool that can help?

    I have no idea in which way they are corrupted, except that the few image viewers that I tried just say variations of "malformed/corrupted file". Google shows me tens of tools, but many of them have no reasonable trial version, or reviews show they recover absolutely nothing, or they're actually adware thinly disguised as something else, or they're intended to recover deleted, not corrupted files... and I don't really feel like spending hours installing tons of random crapware in the vague hope that one of them might maybe do something. I've already tried a couple of those, without any result.

    So, any hint as to what might work?



  • OK, so actually when I copy the files from the SD card they're all full of zeroes, so I guess there aren't many tools that will get anything out of those.

    So now I'm looking at something that can read a borken disk (well, SD card) and pick up bits (quite literally!) out of it. Or I'm just looking at throwing the thing away and think about more interesting things. Probably the latter.


  • Java Dev

    @remi ddrescue?



  • @pleegwat Yeah, now that I'm considering recovering files from a corrupted medium before fixing those files (if possible), that's more straightforward, at least in a first step. Let's see what, if anything, I can get back from the card before trying to interpret that as pictures.


  • Java Dev

    @remi Actually, on further thinking, since the original copy doesn't error out I'm not sure if ddrescue or the like will be much help.


  • Winner of the 2016 Presidential Election

    You are probably screwed. Reading all zeros is a bad sign, and even if they were just corrupted it's likely that the best that could be done would be to extract portions of the image and/or metadata. It's sorta like trying to fix a corrupted zip file - the compression means there's so much dependence on what comes before that small errors can have large effects.


  • Notification Spam Recipient

    @remi said in Land of the lost pictures:

    , so actually when I copy the files from the SD card they're all full of zeroes, so I guess there aren't many tools that will get anything out of those

    Just double checking, but are they full of zeroes on the phone itself?

    I had a problem like this when a ReadyNAS decided literally everything was a virus and just replaced the file content with null characters :facepalm:



  • @remi I don't know what camera you have, but is there a chance in hell it might have also saved a copy of those images in .raw format in some other folder?

    The all zeroes thing is also what the OS puts in the file when it can't read from a scratched-up CD, so I think it might be kind of hopeless for those specific files.

    (There are some file formats where this kind of works so it was a reasonable choice, like old-style sound files which are just series of bytes or possibly BMP files, but almost all modern files are compressed or encoded in such a way that a string of zeroes is going to make them gibberish.)


  • Discourse touched me in a no-no place

    @remi said in Land of the lost pictures:

    they're all full of zeroes

    Sounds like the SD card firmware has remapped junk zeroes over parts of those files. That's going to be basically impossible to recover from without very detailed knowledge of the hardware, and even then it probably won't let you recover anything reasonable as the reason it should even consider doing that is that part of the SD card itself is bad. Or the firmware might be dodgy. Yuck.


  • Considered Harmful

    Was the SD card Chinese crap? Like, is it possible that it had a lot less storage than it said it did?



  • Turns out that during my initial tests to fix the card, I actually overwrote all the original data on the card with what I thought was a backup of it (after having reformatted the card). Including what I thought at the time were just corrupted files, but were in fact full of zero (well, that's a kind of corruption...). All I have is the first copy I made of the card, and that one is already wrong, so I'm screwed.

    Nevermind, as I said all I've lost are a couple of stupid selfies and pics of various DIY bits (you know, like wiring before you undo it so that you know what goes where when putting it back).

    I also got to lose some time (and my temper) because of a bad USB cable which caused the connection to the PC to fail silently (i.e. it never showed the USB options on the phone). Grrr. I guess at least now I've got one less cable in the house, as this one went straight to the bin.



  • @remi said in Land of the lost pictures:

    Turns out that during my initial tests to fix the card, I actually overwrote all the original data on the card

    I was going to post: “Put the write-protect tab on before you do anything else, to prevent the OS or some program from changing the files” but I see there’s no real point in recommending that anymore.


  • Winner of the 2016 Presidential Election

    @gurth said in Land of the lost pictures:

    @remi said in Land of the lost pictures:

    Turns out that during my initial tests to fix the card, I actually overwrote all the original data on the card

    I was going to post: “Put the write-protect tab on before you do anything else, to prevent the OS or some program from changing the files” but I see there’s no real point in recommending that anymore.

    Although that's not a guarantee:

    The user can designate most full-size SD cards as read-only by use of a sliding tab that covers a notch in the card. The miniSD and microSD formats do not support a write protection notch.

    When looking at the SD card from the top, the right side (the side with the beveled corner) must be notched.

    On the left side, there may be a write-protection notch. If the notch is omitted, the card can be read and written. If the card is notched, it is read-only. If the card has a notch and a sliding tab which covers the notch, the user can slide the tab upward (toward the contacts) to declare the card read/write, or downward to declare it read-only. The diagram to the right shows an orange sliding write-protect tab in both the unlocked and locked positions.

    The presence of a notch, and the presence and position of a tab, have no effect on the SD card's operation. A host device that supports write protection should refuse to write to an SD card that is designated read-only in this way. Some host devices do not support write protection, which is an optional feature of the SD specification. Drivers and devices that do obey a read-only indication may give the user a way to override it.

    Cards sold with content that must not be altered are permanently marked read-only by having a notch and no sliding tab.



  • @gurth Yeah, knowing that I had no sensitive data on the card, I wasn't very careful about it (my initial thought was "I'll back it up, reformat, copy back and see what is still there").

    Also, it so happens that the machine on which I have a built-in SD card reader is Windows and I'm less familiar with imaging/FS repair tools than on Linux, so I was more lazy than I would have been otherwise.



  • Sony phone?

    Only ever had SD card issues on Sony phones.



  • @dreikin said in Land of the lost pictures:

    @gurth said in Land of the lost pictures:

    I was going to post: “Put the write-protect tab on before you do anything else, to prevent the OS or some program from changing the files” but I see there’s no real point in recommending that anymore.

    Although that's not a guarantee:

    Oh, great, it’s a software safety rather than a hardware one … whoever thought that was a good idea?


  • Banned

    @gurth it worked for VHS 🤷♀


  • 🚽 Regular

    @gurth said in Land of the lost pictures:

    @dreikin said in Land of the lost pictures:

    @gurth said in Land of the lost pictures:

    I was going to post: “Put the write-protect tab on before you do anything else, to prevent the OS or some program from changing the files” but I see there’s no real point in recommending that anymore.

    Although that's not a guarantee:

    Oh, great, it’s a software safety rather than a hardware one … whoever thought that was a good idea?

    The same designers as the Therac-25?



  • @gąska I, for some reason, expect mechanical safeties (like a sliding tab on a cassette, disk, memory card, etc.) to activate a mechanism that actually interrupts the electrical signal to write data. Probably just me being naïve, I suppose, based on the way most cassette recorders work(ed).


  • Banned

    @gurth I don't know anything about how VHS players are built to be honest, but I always imagined mechanical/optical switch that fired up a circuit, which the microcontroller interpreted as "do not write". It's technically hardware, but has all the same problems as software blockade.



  • @gąska Video recorders probably do work that way. Cassette (audio) players usually mechanically lock the Record button if the tab is removed from the tape. But a 5.25 inch diskette drive I happen to have lying around has an optical sensor for the notch you can cut into a disk to make it write-enabled (near the top of the right-hand side in the following image).



  • @gurth I see your ruler also has a write-enable notch. 🎛



  • @scarlet_manuka My rulers are read-only, else I’d overwrite the inches with real units of measurement.

    As for the photo: maybe it’s just my OCD, but if you’re going to take a picture of a diskette like that, wouldn’t you align the 0 mark with its corner so the actual size can be read off in the photo?



  • @ben_warre said in Land of the lost pictures:

    Sony phone?

    Only ever had SD card issues on Sony phones.

    Nope, Huawei. I guess I was just unlucky and got a failed SD card, that happens. In hindsight, I remember having seen some weird issues from day 1, when I copied all my pictures from my old phone to the new one, some didn't go through... at the time I put that on different formats, Android versions etc. but actually that probably was a symptom of the card failing.

    What surprises me a little is that the only problem I've seen is with pictures. If the card is bad (to the point where at least 1/3 or 1/2 of pictures get corrupted), I would expect random failures in other stuff. I guess because the apps are on the phone memory (not the SD card), there isn't much stuff on the card apart from pictures, and nothing really vital to most apps...


Log in to reply