Thursday, April 2, 2009

Bitmap Image file Validator/Checker

I've created this program as a part of a project 'Image Enhancer'. This Program can be used to check whether the given file is a valid BMP file or not. Just compile the source code and enter the absolute file path in the prompt. (Ex-c:\test\text.bmp)

//Checking and validation of an BMP ImageFile
#include<>
#include<>
#include<>
#include<>
#include<>
#include<>
#include<>
#define BMPTYPE (((WORD) 'M' << must="="'BM'" ex="c:\tc\text.bmp):" length =" strlen(inname);" i =" 0;">= 'a') && (inname[i] <= 'z')){
inname[i] = toupper(inname[i]);
}
}
//fpath=inname;
FILE *infp;
//strcpy( inname, argv[1]);
infp = fopen( inname, "r");
if( ! infp)
{
printf("\n Unable to open %s for input\n", inname);
printf("Try again..");
getch();
//main();
// exit(1);
}
printf("Verifying file....");
delay(1000);
bmp(infp);
fclose(infp);
printf("\nPress any key to exit\n");
getch();
// exit(0);
}
Post a Comment

Popular Posts