| 7330 | |
| 7331 | #ifndef STBI_NO_BMP |
| 7332 | static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp) |
| 7333 | { |
| 7334 | void *p; |
| 7335 | stbi__bmp_data info; |
| 7336 | |
| 7337 | info.all_a = 255; |
| 7338 | p = stbi__bmp_parse_header(s, &info); |
| 7339 | if (p == NULL) { |
| 7340 | stbi__rewind( s ); |
| 7341 | return 0; |
| 7342 | } |
| 7343 | if (x) *x = s->img_x; |
| 7344 | if (y) *y = s->img_y; |
| 7345 | if (comp) { |
| 7346 | if (info.bpp == 24 && info.ma == 0xff000000) |
| 7347 | *comp = 3; |
| 7348 | else |
| 7349 | *comp = info.ma ? 4 : 3; |
| 7350 | } |
| 7351 | return 1; |
| 7352 | } |
| 7353 | #endif |
| 7354 | |
| 7355 | #ifndef STBI_NO_PSD |
no test coverage detected