diff --git a/src/common/bmp_file.c b/src/common/bmp_file.c index 37bd8dd..bb7efb5 100644 --- a/src/common/bmp_file.c +++ b/src/common/bmp_file.c @@ -63,8 +63,9 @@ int bmp_load(char * file,bitmap_data * bdata) ysize=bitmap_info_header.biHeight; bitperpixel=bitmap_info_header.biBitCount; - if(!bitmap_info_header.biCompression) + if(!bitmap_info_header.biCompression || (bitmap_info_header.biCompression == BI_BITFIELDS) ) { + // TODO : Read and use the BI_BITFIELDS RGB masks. // read palette switch(bitperpixel) @@ -85,6 +86,7 @@ int bmp_load(char * file,bitmap_data * bdata) palettesize=0; break; default: + //printf("bmp_load : bitperpixel not supported : %d\n",bitperpixel); palettesize=0; //non supported break; @@ -271,6 +273,7 @@ int bmp_load(char * file,bitmap_data * bdata) else { // non supported + //printf("bmp_load : Packed bmp not supported : %d\n",bitmap_info_header.biCompression); fclose(f); return -1; } diff --git a/src/common/bmp_file.h b/src/common/bmp_file.h index 28d271b..a2aacfd 100644 --- a/src/common/bmp_file.h +++ b/src/common/bmp_file.h @@ -1,5 +1,9 @@ #pragma pack(1) +#ifndef BI_BITFIELDS +#define BI_BITFIELDS 3 +#endif + typedef struct bitmap_data_ { int16_t xsize;