| 8029 | |
| 8030 | #ifndef STBI_NO_BMP |
| 8031 | static int stbi__bmp_info(stbi__context* s, int* x, int* y, int* comp) { |
| 8032 | void* p; |
| 8033 | stbi__bmp_data info; |
| 8034 | |
| 8035 | info.all_a = 255; |
| 8036 | p = stbi__bmp_parse_header(s, &info); |
| 8037 | if (p == NULL) { |
| 8038 | stbi__rewind(s); |
| 8039 | return 0; |
| 8040 | } |
| 8041 | if (x) |
| 8042 | *x = s->img_x; |
| 8043 | if (y) |
| 8044 | *y = s->img_y; |
| 8045 | if (comp) { |
| 8046 | if (info.bpp == 24 && info.ma == 0xff000000) |
| 8047 | *comp = 3; |
| 8048 | else |
| 8049 | *comp = info.ma ? 4 : 3; |
| 8050 | } |
| 8051 | return 1; |
| 8052 | } |
| 8053 | #endif |
| 8054 | |
| 8055 | #ifndef STBI_NO_PSD |
no test coverage detected