From d3d2d7493cf1d8ffda071e3f170fe58acaad13a6 Mon Sep 17 00:00:00 2001 From: Jaeun Choi Date: Wed, 30 Nov 2016 11:37:26 +0900 Subject: [PATCH] evas: bug fix in bmp loader when the DIB header is BITMAPINFOHEADER (size 40), a bitmap file has alpha channel only if the compression method is BI_ALPHABITFIELDS (= 6). the original code enabled alpha channel when the compression method was BI_RGB (= 0), which made an opaque bmp image loaded as a transparent one. @fix Change-Id: Id175c82294c064d0d87c7f8fa9ccafcda8f84611 --- src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c b/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c index 49fb4e8..f798333 100644 --- a/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c +++ b/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c @@ -205,7 +205,7 @@ _evas_image_load_file_header(void *map, size_t fsize, size_t *position, int *ima if (!read_int(map, fsize, position, &tmp2)) return EINA_FALSE; //important_colors = tmp2; // number of important colors - 0 if all if (*image_size == 0) *image_size = fsize - header->offset; - if ((header->comp == 0) && (header->bit_count == 32)) header->hasa = 1; // GIMP seems to store it this way + if ((header->comp == 6) && (header->bit_count == 32)) header->hasa = 1; break; } case 108: // Windows 95/NT4 + (v4) -- 2.7.4