recover jpeg from .raw file

This is a discussion on recover jpeg from .raw file within the C Programming forums, part of the General Programming Boards category; Hello everyone, I am working on a c program which recovers jpeg files from .raw file of a memory card.My ...

  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    2

    Post recover jpeg from .raw file

    Hello everyone, I am working on a c program which recovers jpeg files from .raw file of a memory card.My code is here-

    Code:
    #include<stdio.h>
    #include<stdlib.h>
    
    
    int main(void)
    {
    
    
    File* inptr=fopen("card.raw","r")
    if(inptr==NULL)
    {
     return 1;
     }
     
    File* outptr;
     int count=0;
     char filename[8];
     char buffer[]=(sizeof(char)*512);
     while(!feof(inptr))
     {
     
     fread(&buffer,sizeof(char)*512,1,inptr);
     
     if(fread(&buffer,sizeof(char)*512,1,inptr)==0)
     break;
     
     if(buffer[0] == 0xff && buffer[1] == 0xd8 && buffer[2] == 0xff && ((buffer[3] == 0xe0)||(buffer[3] == 0xe1)))
     {
     
     if (count! =0)
       fclose(outptr);
     sprintf(filename,"%03d.jpg",count++);
     outptr=fopen(filename,"w");
     }
     
     if(fwrite(&buffer,sizeof(char),512,outptr)!=0)
       fwrite(&buffer,sizeof(char),512,outptr);
     }
     
    fclose(outptr);
    fclose(inptr);
    return 0;
    }

    But while compiling it I get this error-

    Makefile:2: *** missing separator. Stop.

    Could anyone please help me to fix this problem?

  2. #2
    ZuK
    ZuK is offline
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    The error is in the makefile.
    Kurt

  3. #3
    Registered User
    Join Date
    Mar 2013
    Posts
    2
    Thank you Kurt.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Recovering jpeg images from a .raw file
    By Dude22 in forum C Programming
    Replies: 18
    Last Post: 03-07-2013, 10:55 AM
  2. Char [] to Image File (JPEG)
    By TranT in forum C Programming
    Replies: 33
    Last Post: 07-06-2009, 12:38 PM
  3. Help reading a jpeg file into frames of 100 bytes!! :S
    By rodiannef in forum C Programming
    Replies: 4
    Last Post: 12-10-2008, 12:12 AM
  4. Loading from resources and showing a JPEG file
    By dit6a9 in forum Windows Programming
    Replies: 3
    Last Post: 02-27-2005, 02:31 PM
  5. HELP - How can I recover deleted file?
    By brett in forum Linux Programming
    Replies: 5
    Last Post: 09-30-2003, 11:10 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21