Dec. 26th, 2003

acb: (Default)
I took [livejournal.com profile] 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.
acb: (buttons)
Something for the Melbourne people:

Poplounge, the laid-back indie/bowlie/pop/&c. night I'm involved in, is having its launch this Sunday evening, at the Rochester Castle Hotel (202 Johnston St., Fitzroy; between Brunswick St. and Smith St.). It kicks off at 5pm, with a free (vegetarian-friendly) barbecue; later there will be board games, a screening of Belle & Sebastian's Fans Only, and, of course, DJs (including yours truly) spinning lots of good music until 10. Entry is free.

September 2015

S M T W T F S
  12345
6 789101112
13141516171819
20212223242526
27282930   

Most Popular Tags

Active Entries

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 29th, 2026 10:14 pm
Powered by Dreamwidth Studios