MCPcopy Create free account
hub / github.com/DentonW/DevIL / ilIsValidPsd

Function ilIsValidPsd

DevIL/src-IL/src/il_psd.cpp:43–64  ·  view source on GitHub ↗

Checks if the file specified in FileName is a valid Psd file.

Source from the content-addressed store, hash-verified

41
42//! Checks if the file specified in FileName is a valid Psd file.
43ILboolean 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.

Callers 1

ILAPIENTRY ilIsValidFunction · 0.85

Calls 3

iCheckExtensionFunction · 0.85
ilSetErrorFunction · 0.85
ilIsValidPsdFFunction · 0.85

Tested by

no test coverage detected