On Tue, Feb 9, 2010 at 11:44 AM, satish uniyal <[email protected]> wrote:
> Dear friends,
>
> Could you please share, How to read jpeg or bmp file in c language?
/** Untested **/
char buff[512];
int r = 0;
FILE* fp = fopen("~/mypic.jpg", "rb");
while( fp && (r = fread(buff, sizeof buff, 1, fp) == sizeof buff){
printf("Read in %d bytes\n", r):
}
if (r > 0 && feof(fp)){
printf("Read in %d bytes\n", r):
}else{
printf("Error reading file\n");
}
fclose(fp);
--
PJH
http://shabbleland.myminicity.com/env
http://www.chavgangs.com/register.php?referer=9375