This function detects the format of the image file specified by a filename.
Declaration:
AT_ERRCOUNT ACCUAPI IG_fltr_detect_file(
const LPSTR lpszFileName,
LPAT_MODE lpFileType
);
Arguments:
Name |
Type |
Description |
lpszFileName |
const LPSTR |
File name of the image which format you wish to detect. |
lpFileType |
LPAT_MODE |
Pointer to an AT_MODE variable in which the file type will be returned. See enumIGFormats for possible values. If the file format can not be detected, this parameter will return IG_FORMAT_UNKNOWN. |
Return Value:
Returns 0 if successful. Otherwise, returns the number of ImageGear errors that occurred during this function call.
This function does not process image pixels.
Sample:
Filter
Example:
AT_ERRCOUNT nErrCount; // will hold returned error count
AT_MODE nFormatID;
nErrCount = IG_fltr_detect_file("picture.tif", &nFormatID);
if(nFormatID == IG_FORMAT_TIF)
{
// ...
}
See also the section Detecting Image File Format.