Checks if the file specified in FileName is a valid Psd file.
| 41 | |
| 42 | //! Checks if the file specified in FileName is a valid Psd file. |
| 43 | ILboolean ilIsValidPsd(ILconst_string FileName) |
| 44 | { |
| 45 | ILHANDLE PsdFile; |
| 46 | ILboolean bPsd = IL_FALSE; |
| 47 | |
| 48 | if (!iCheckExtension(FileName, IL_TEXT("psd")) && |
| 49 | !iCheckExtension(FileName, IL_TEXT("pdd"))) { |
| 50 | ilSetError(IL_INVALID_EXTENSION); |
| 51 | return bPsd; |
| 52 | } |
| 53 | |
| 54 | PsdFile = iopenr(FileName); |
| 55 | if (PsdFile == NULL) { |
| 56 | ilSetError(IL_COULD_NOT_OPEN_FILE); |
| 57 | return bPsd; |
| 58 | } |
| 59 | |
| 60 | bPsd = ilIsValidPsdF(PsdFile); |
| 61 | icloser(PsdFile); |
| 62 | |
| 63 | return bPsd; |
| 64 | } |
| 65 | |
| 66 | |
| 67 | //! Checks if the ILHANDLE contains a valid Psd file at the current position. |
no test coverage detected