reading a .raw file
in
Programming Questions
•
2 years ago
Hey guys. Thanks for your help on the previous thread. I never replied because I was on a school unit and couldn't log in, but it did solve my problem.
I've been assigned to write a program that will convert a binary .raw file to JPGs. A fellow colleague of mine has taken his camera's SD card and used an online utility to capture a byte-by-byte raw image file of the entire card, hoping that a program can be written that will recover these images. It's around thirty megabytes, so it's maybe (fifteen?) pictures.
He says that JPG image files start with one of two four-byte sequences
0xFF 0xD8 0xFF 0xE0
0xFF 0xD8 0xFF 0xE1
My questions are these
How do I read through this .raw file one byte at a time in order to find the beginning and end of each picture? I'm not sure how to load the raw file either.
If I were to read through this .raw file one byte at a time, and separate the blocks of binary into chunks, how would I save them into differently named images? Like image1, image2, etc
Thanks guys
1