this is not your sawtooth wave (kineticfactory) wrote,
this is not your sawtooth wave
kineticfactory

Memory Card Blues update

I took reddragdiva's advice and had a go at recovering the contents of my dying memory card; to wit, I wrote a small program* to mmap() a file (such as the image of a memory card), search it for JFIF magic numbers and write the spans between them to consecutively-numbered files, and ended up with some 586 files from the memory card image. Some were truncated beyond usability, some were left over from last year's UK trip (lots of shots of Inverness and bits of Scotland/Yorkshire from a train window), and others looked like the missing photos.

Since all the missing photos were taken consecutively, and all the files have EXIF headers (that's a JPEG extension most digital cameras use, which includes things like exposure information and a timestamp), filtering them out of the pile should be a matter of running exif-date on the lot and sorting out the ones before and after the missing time period.

* Why did I write the program in C, you ask? Well, the idea of going through 500Mb of data with Perl regular expressions or something made me wince. As did the idea of reading it piecemeal into small buffers and reconstructing it from there (lots of overhead and/or extra code). Besides which, finding spans of memory between magic numbers in a block of memory (such as a mmap()ed file) is something that's sufficiently painless to do in C.
Subscribe

  • Get Zucked

    It looks like Facebook ads are about to get much more obnoxious. We're talking huge, bandwidth-sucking full-motion video ads along the side of your…

  • Lyrics quiz

    It has been a while since I posted one of these. Below are 10 lyrics from songs. For each one, if you know the artist and song title, post them in…

  • Laura Macfarlane/Hong Kong In The 60s/Hissing At Swans

    Last night, I made a return to putting gigs on. So far, a once-off, though there may well be more gigs in the future. I put on a gig by Laura…

  • Comments for this post were locked by the author
  • Comments for this post were locked by the author