| 7357 | |
| 7358 | #ifndef STBI_NO_PSD |
| 7359 | static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp) |
| 7360 | { |
| 7361 | int channelCount, dummy, depth; |
| 7362 | if (!x) x = &dummy; |
| 7363 | if (!y) y = &dummy; |
| 7364 | if (!comp) comp = &dummy; |
| 7365 | if (stbi__get32be(s) != 0x38425053) { |
| 7366 | stbi__rewind( s ); |
| 7367 | return 0; |
| 7368 | } |
| 7369 | if (stbi__get16be(s) != 1) { |
| 7370 | stbi__rewind( s ); |
| 7371 | return 0; |
| 7372 | } |
| 7373 | stbi__skip(s, 6); |
| 7374 | channelCount = stbi__get16be(s); |
| 7375 | if (channelCount < 0 || channelCount > 16) { |
| 7376 | stbi__rewind( s ); |
| 7377 | return 0; |
| 7378 | } |
| 7379 | *y = stbi__get32be(s); |
| 7380 | *x = stbi__get32be(s); |
| 7381 | depth = stbi__get16be(s); |
| 7382 | if (depth != 8 && depth != 16) { |
| 7383 | stbi__rewind( s ); |
| 7384 | return 0; |
| 7385 | } |
| 7386 | if (stbi__get16be(s) != 3) { |
| 7387 | stbi__rewind( s ); |
| 7388 | return 0; |
| 7389 | } |
| 7390 | *comp = 4; |
| 7391 | return 1; |
| 7392 | } |
| 7393 | |
| 7394 | static int stbi__psd_is16(stbi__context *s) |
| 7395 | { |
no test coverage detected