aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/src/modules/loaders/bmp/evas_image_load_bmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/evas/src/modules/loaders/bmp/evas_image_load_bmp.c')
-rw-r--r--libraries/evas/src/modules/loaders/bmp/evas_image_load_bmp.c108
1 files changed, 52 insertions, 56 deletions
diff --git a/libraries/evas/src/modules/loaders/bmp/evas_image_load_bmp.c b/libraries/evas/src/modules/loaders/bmp/evas_image_load_bmp.c
index 6d15783..9453ceb 100644
--- a/libraries/evas/src/modules/loaders/bmp/evas_image_load_bmp.c
+++ b/libraries/evas/src/modules/loaders/bmp/evas_image_load_bmp.c
@@ -107,12 +107,8 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key
107 void *map = NULL; 107 void *map = NULL;
108 size_t position = 0; 108 size_t position = 0;
109 char hasa = 0; 109 char hasa = 0;
110 int w = 0, h = 0, planes = 0, bit_count = 0, 110 int w = 0, h = 0, bit_count = 0, image_size = 0, comp = 0;
111 image_size = 0, comp = 0, hdpi = 0, vdpi = 0, 111 unsigned int offset, head_size, amask = 0;
112 palette_size = -1, important_colors = 0;
113 unsigned int offset, head_size, rmask = 0, gmask = 0, bmask = 0, amask = 0;
114 unsigned int pal_num = 0;
115 int right_way_up = 0;
116 int fsize = 0; 112 int fsize = 0;
117 unsigned int bmpsize; 113 unsigned int bmpsize;
118 unsigned short res1, res2; 114 unsigned short res1, res2;
@@ -148,7 +144,7 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key
148 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 144 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
149 h = tmp; // height 145 h = tmp; // height
150 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 146 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
151 planes = tmp; // must be 1 147 //planes = tmp; // must be 1
152 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 148 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
153 bit_count = tmp; // bits per pixel: 1, 4, 8 & 24 149 bit_count = tmp; // bits per pixel: 1, 4, 8 & 24
154 } 150 }
@@ -162,7 +158,7 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key
162 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 158 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
163 h = tmp2; // height 159 h = tmp2; // height
164 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 160 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
165 planes = tmp; // must be 1 161 //planes = tmp; // must be 1
166 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 162 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
167 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 163 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
168 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 164 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
@@ -170,13 +166,13 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key
170 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 166 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
171 image_size = tmp2; // bitmap data size 167 image_size = tmp2; // bitmap data size
172 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 168 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
173 hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter 169 //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
174 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 170 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
175 vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter 171 //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
176 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 172 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
177 palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) 173 //palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
178 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 174 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
179 important_colors = tmp2; // number of important colors - 0 if all 175 //important_colors = tmp2; // number of important colors - 0 if all
180 if (!read_skip(fsize, &position, 24)) goto close_file; // skip unused header 176 if (!read_skip(fsize, &position, 24)) goto close_file; // skip unused header
181 if (image_size == 0) image_size = fsize - offset; 177 if (image_size == 0) image_size = fsize - offset;
182 } 178 }
@@ -190,7 +186,7 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key
190 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 186 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
191 h = tmp2; // height 187 h = tmp2; // height
192 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 188 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
193 planes = tmp; // must be 1 189 //planes = tmp; // must be 1
194 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 190 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
195 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 191 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
196 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 192 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
@@ -198,13 +194,13 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key
198 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 194 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
199 image_size = tmp2; // bitmap data size 195 image_size = tmp2; // bitmap data size
200 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 196 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
201 hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter 197 //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
202 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 198 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
203 vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter 199 //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
204 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 200 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
205 palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) 201 //palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
206 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 202 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
207 important_colors = tmp2; // number of important colors - 0 if all 203 //important_colors = tmp2; // number of important colors - 0 if all
208 if (image_size == 0) image_size = fsize - offset; 204 if (image_size == 0) image_size = fsize - offset;
209 if ((comp == 0) && (bit_count == 32)) hasa = 1; // GIMP seems to store it this way 205 if ((comp == 0) && (bit_count == 32)) hasa = 1; // GIMP seems to store it this way
210 } 206 }
@@ -218,7 +214,7 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key
218 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 214 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
219 h = tmp2; // height 215 h = tmp2; // height
220 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 216 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
221 planes = tmp; // must be 1 217 //planes = tmp; // must be 1
222 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 218 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
223 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 219 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
224 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 220 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
@@ -226,19 +222,19 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key
226 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 222 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
227 image_size = tmp2; // bitmap data size 223 image_size = tmp2; // bitmap data size
228 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 224 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
229 hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter 225 //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
230 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 226 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
231 vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter 227 //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
232 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 228 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
233 palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) 229 //palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
234 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 230 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
235 important_colors = tmp2; // number of important colors - 0 if all 231 //important_colors = tmp2; // number of important colors - 0 if all
236 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 232 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
237 rmask = tmp2; // red mask 233 //rmask = tmp2; // red mask
238 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 234 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
239 gmask = tmp2; // green mask 235 //gmask = tmp2; // green mask
240 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 236 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
241 bmask = tmp2; // blue mask 237 //bmask = tmp2; // blue mask
242 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 238 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
243 amask = tmp2; // alpha mask 239 amask = tmp2; // alpha mask
244 if (!read_skip(fsize, &position, 36)) goto close_file; // skip unused cie 240 if (!read_skip(fsize, &position, 36)) goto close_file; // skip unused cie
@@ -256,27 +252,27 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key
256 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 252 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
257 h = tmp2; // height 253 h = tmp2; // height
258 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 254 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
259 planes = tmp; // must be 1 255 //planes = tmp; // must be 1
260 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 256 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
261 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 257 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
262 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 258 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
263 comp = tmp2; // compression method 259 comp = tmp2; // compression method
264 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 260 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
265 image_size = tmp2; // bitmap data size 261 //image_size = tmp2; // bitmap data size
266 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 262 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
267 hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter 263 //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
268 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 264 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
269 vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter 265 //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
270 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 266 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
271 palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) 267 //palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
272 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 268 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
273 important_colors = tmp2; // number of important colors - 0 if all 269 //important_colors = tmp2; // number of important colors - 0 if all
274 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 270 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
275 rmask = tmp2; // red mask 271 //rmask = tmp2; // red mask
276 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 272 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
277 gmask = tmp2; // green mask 273 //gmask = tmp2; // green mask
278 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 274 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
279 bmask = tmp2; // blue mask 275 //bmask = tmp2; // blue mask
280 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 276 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
281 amask = tmp2; // alpha mask 277 amask = tmp2; // alpha mask
282 if (!read_skip(fsize, &position, 36)) goto close_file; // skip unused cie 278 if (!read_skip(fsize, &position, 36)) goto close_file; // skip unused cie
@@ -291,7 +287,7 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key
291 if (h < 0) 287 if (h < 0)
292 { 288 {
293 h = -h; 289 h = -h;
294 right_way_up = 1; 290 //right_way_up = 1;
295 } 291 }
296 292
297 if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) || 293 if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) ||
@@ -313,8 +309,8 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key
313 309
314 if (bit_count < 16) 310 if (bit_count < 16)
315 { 311 {
316 if ((palette_size < 0) || (palette_size > 256)) pal_num = 256; 312 //if ((palette_size < 0) || (palette_size > 256)) pal_num = 256;
317 else pal_num = palette_size; 313 //else pal_num = palette_size;
318 if (bit_count == 1) 314 if (bit_count == 1)
319 { 315 {
320 if (comp == 0) // no compression 316 if (comp == 0) // no compression
@@ -389,8 +385,8 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
389 size_t position = 0; 385 size_t position = 0;
390 unsigned char *buffer = NULL, *buffer_end = NULL, *p; 386 unsigned char *buffer = NULL, *buffer_end = NULL, *p;
391 char hasa = 0; 387 char hasa = 0;
392 int x = 0, y = 0, w = 0, h = 0, planes = 0, bit_count = 0, image_size = 0, 388 int x = 0, y = 0, w = 0, h = 0, bit_count = 0, image_size = 0,
393 comp = 0, hdpi = 0, vdpi = 0, palette_size = -1, important_colors = 0; 389 comp = 0, palette_size = -1;
394 unsigned int offset = 0, head_size = 0; 390 unsigned int offset = 0, head_size = 0;
395 unsigned int *pal = NULL, pal_num = 0, *pix = NULL, *surface = NULL, fix, 391 unsigned int *pal = NULL, pal_num = 0, *pix = NULL, *surface = NULL, fix,
396 rmask = 0, gmask = 0, bmask = 0, amask = 0; 392 rmask = 0, gmask = 0, bmask = 0, amask = 0;
@@ -440,7 +436,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
440 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 436 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
441 h = tmp; // height 437 h = tmp; // height
442 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 438 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
443 planes = tmp; // must be 1 439 //planes = tmp; // must be 1
444 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 440 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
445 bit_count = tmp; // bits per pixel: 1, 4, 8 & 24 441 bit_count = tmp; // bits per pixel: 1, 4, 8 & 24
446 } 442 }
@@ -454,7 +450,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
454 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 450 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
455 h = tmp2; // height 451 h = tmp2; // height
456 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 452 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
457 planes = tmp; // must be 1 453 //planes = tmp; // must be 1
458 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 454 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
459 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 455 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
460 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 456 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
@@ -462,13 +458,13 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
462 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 458 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
463 image_size = tmp2; // bitmap data size 459 image_size = tmp2; // bitmap data size
464 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 460 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
465 hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter 461 //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
466 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 462 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
467 vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter 463 //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
468 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 464 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
469 palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) 465 palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
470 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 466 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
471 important_colors = tmp2; // number of important colors - 0 if all 467 //important_colors = tmp2; // number of important colors - 0 if all
472 if (!read_skip(fsize, &position, 24)) goto close_file; // skip unused header 468 if (!read_skip(fsize, &position, 24)) goto close_file; // skip unused header
473 if (image_size == 0) image_size = fsize - offset; 469 if (image_size == 0) image_size = fsize - offset;
474 } 470 }
@@ -482,7 +478,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
482 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 478 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
483 h = tmp2; // height 479 h = tmp2; // height
484 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 480 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
485 planes = tmp; // must be 1 481 //planes = tmp; // must be 1
486 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 482 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
487 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 483 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
488 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 484 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
@@ -490,13 +486,13 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
490 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 486 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
491 image_size = tmp2; // bitmap data size 487 image_size = tmp2; // bitmap data size
492 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 488 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
493 hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter 489 //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
494 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 490 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
495 vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter 491 //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
496 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 492 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
497 palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) 493 palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
498 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 494 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
499 important_colors = tmp2; // number of important colors - 0 if all 495 //important_colors = tmp2; // number of important colors - 0 if all
500 if (image_size == 0) image_size = fsize - offset; 496 if (image_size == 0) image_size = fsize - offset;
501 if ((comp == 0) && (bit_count == 32)) hasa = 1; // GIMP seems to store it this way 497 if ((comp == 0) && (bit_count == 32)) hasa = 1; // GIMP seems to store it this way
502 } 498 }
@@ -510,7 +506,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
510 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 506 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
511 h = tmp2; // height 507 h = tmp2; // height
512 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 508 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
513 planes = tmp; // must be 1 509 //planes = tmp; // must be 1
514 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 510 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
515 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 511 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
516 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 512 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
@@ -518,13 +514,13 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
518 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 514 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
519 image_size = tmp2; // bitmap data size 515 image_size = tmp2; // bitmap data size
520 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 516 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
521 hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter 517 //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
522 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 518 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
523 vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter 519 //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
524 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 520 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
525 palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) 521 palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
526 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 522 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
527 important_colors = tmp2; // number of important colors - 0 if all 523 //important_colors = tmp2; // number of important colors - 0 if all
528 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 524 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
529 rmask = tmp2; // red mask 525 rmask = tmp2; // red mask
530 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 526 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
@@ -548,7 +544,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
548 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 544 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
549 h = tmp2; // height 545 h = tmp2; // height
550 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 546 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
551 planes = tmp; // must be 1 547 //planes = tmp; // must be 1
552 if (!read_short(map, fsize, &position, &tmp)) goto close_file; 548 if (!read_short(map, fsize, &position, &tmp)) goto close_file;
553 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 549 bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
554 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 550 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
@@ -556,13 +552,13 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
556 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 552 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
557 image_size = tmp2; // bitmap data size 553 image_size = tmp2; // bitmap data size
558 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 554 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
559 hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter 555 //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
560 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 556 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
561 vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter 557 //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
562 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 558 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
563 palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) 559 palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
564 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 560 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
565 important_colors = tmp2; // number of important colors - 0 if all 561 //important_colors = tmp2; // number of important colors - 0 if all
566 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 562 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
567 rmask = tmp2; // red mask 563 rmask = tmp2; // red mask
568 if (!read_int(map, fsize, &position, &tmp2)) goto close_file; 564 if (!read_int(map, fsize, &position, &tmp2)) goto close_file;