Checks if the file specified in FileName is a valid .bmp file.
| 21 | |
| 22 | //! Checks if the file specified in FileName is a valid .bmp file. |
| 23 | ILboolean ilIsValidBmp(ILconst_string CONST_RESTRICT FileName) |
| 24 | { |
| 25 | ILHANDLE BitmapFile; |
| 26 | ILboolean bBitmap = IL_FALSE; |
| 27 | |
| 28 | if (!iCheckExtension(FileName, IL_TEXT("bmp"))) { |
| 29 | ilSetError(IL_INVALID_EXTENSION); |
| 30 | return bBitmap; |
| 31 | } |
| 32 | |
| 33 | BitmapFile = iopenr(FileName); |
| 34 | if (BitmapFile == NULL) { |
| 35 | ilSetError(IL_COULD_NOT_OPEN_FILE); |
| 36 | return bBitmap; |
| 37 | } |
| 38 | |
| 39 | bBitmap = ilIsValidBmpF(BitmapFile); |
| 40 | icloser(BitmapFile); |
| 41 | |
| 42 | return bBitmap; |
| 43 | } |
| 44 | |
| 45 | |
| 46 | //! Checks if the ILHANDLE contains a valid .bmp file at the current position. |
no test coverage detected