Internal function used to check if the HEADER is a valid Psd header.
| 117 | |
| 118 | // Internal function used to check if the HEADER is a valid Psd header. |
| 119 | ILboolean iCheckPsd(PSDHEAD *Header) |
| 120 | { |
| 121 | ILuint i; |
| 122 | |
| 123 | if (strncmp((char*)Header->Signature, "8BPS", 4)) |
| 124 | return IL_FALSE; |
| 125 | if (Header->Version != 1) |
| 126 | return IL_FALSE; |
| 127 | for (i = 0; i < 6; i++) { |
| 128 | if (Header->Reserved[i] != 0) |
| 129 | return IL_FALSE; |
| 130 | } |
| 131 | if (Header->Channels < 1 || Header->Channels > 24) |
| 132 | return IL_FALSE; |
| 133 | if (Header->Height < 1 || Header->Width < 1) |
| 134 | return IL_FALSE; |
| 135 | if (Header->Depth != 1 && Header->Depth != 8 && Header->Depth != 16) |
| 136 | return IL_FALSE; |
| 137 | |
| 138 | return IL_TRUE; |
| 139 | } |
| 140 | |
| 141 | |
| 142 | //! Reads a Psd file |
no outgoing calls
no test coverage detected