B"H On 9/12/05, m ike <[EMAIL PROTECTED]> wrote: > using the binary editor called bed, i can laboriously recover vacation jpgs > from FAT16 CF card that I had mistakenly reformatted. > > the best that I can come up with, however, is to use bed to find the byte > offset of the beginning and end of each jpg. save all the offsets > in a file. then use tail and head with -c to dissect each jpg. > > but since I know the beginning and ending hexadecimal markers for exif files > (FF D8 and FF D9), it seems that there should be a way to script this task. > it would be extremely helpful to be able to use grep to find the offsets, > but I cannot figure out how to use grep in this manner, and have not been > able to find an alternative to grep that will do this. > > (and grep returns the byte offset of the line, not the match) > > any pointers would be appreciated. >
Mike Hearn (Wine and Autopacher) wrote a tool that may help you out. It is called extract-jpeg. Here is an excerpt from his site <http://plan99.net/~mike/>: ---start quote------- One day a friend came to me with a problem: she had deleted all her photos from her digital camera. That was 430 pictures from China, gone from the cameras memory card. Data recovery is expensive, so when she mentioned this I said I'd take a look. Unfortunately this camera optimizes FAT directory cluster scans by using lots of directories with only a few files in, and automatic undelete tools could do nothing. So I wrote extract-jpeg [Linux/x86 binary] to dump them from the disk image by brute force. Maybe if you (or your friend) suffers the same fate this program can help you too! It was able to recover 397 of the photos correctly, which isn't bad. Unfortunately if your cameras storage is heavily fragmented this program won't do much for you, it needs to understand how to read the file allocation tables for that. It doesn't run on Windows either, but if you pay me or if your sob story is good enough I'll port it across for you. ----end quote------ Menachem > Mike > > -- > [email protected] > http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list > -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
