#This program was written by Nathan Stenzel, nathanstenzel@users.sourceforge.net #You can find my Polaroid 320 project (this program is for that) at nathanstenzel.tripod.com. #You want to do dat3jpg whateverjpegfile whateverdatfile > whereveryouwant.jpg #include #include int main(int argc, char **argv) { FILE * hdr; FILE * src; int x; char c; if (argc != 3) { perror("Enter the header and data file names\n"); return 1; } if ((hdr = fopen(argv[1], "r"))==NULL) { perror("Can't open the jpeg file containing the header\n"); return 2; } if ((src = fopen(argv[2], "r"))==NULL) { perror("Can't open the image data file\n"); return 2; } for (x=0; (x<0x26f)&&(!feof(hdr)); x++) { c=getc(hdr); printf("%c",c); } fclose(hdr); for (x=0; (x<0x6)&&(!feof(src)); x++) c=getc(src); while (!feof(src)) { c=getc(src); printf("%c",c); } fclose(src); }