diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/evas/src/modules/loaders/bmp/Makefile.am | 7 | ||||
-rw-r--r-- | libraries/evas/src/modules/loaders/bmp/Makefile.in | 13 | ||||
-rw-r--r-- | libraries/evas/src/modules/loaders/bmp/evas_image_load_bmp.c | 108 |
3 files changed, 61 insertions, 67 deletions
diff --git a/libraries/evas/src/modules/loaders/bmp/Makefile.am b/libraries/evas/src/modules/loaders/bmp/Makefile.am index 857f3b9..0a04790 100644 --- a/libraries/evas/src/modules/loaders/bmp/Makefile.am +++ b/libraries/evas/src/modules/loaders/bmp/Makefile.am | |||
@@ -8,8 +8,7 @@ AM_CPPFLAGS = \ | |||
8 | @FREETYPE_CFLAGS@ \ | 8 | @FREETYPE_CFLAGS@ \ |
9 | @PIXMAN_CFLAGS@ \ | 9 | @PIXMAN_CFLAGS@ \ |
10 | @EINA_CFLAGS@ \ | 10 | @EINA_CFLAGS@ \ |
11 | @EVIL_CFLAGS@ \ | 11 | @EVIL_CFLAGS@ |
12 | @WIN32_CPPFLAGS@ | ||
13 | 12 | ||
14 | if BUILD_LOADER_BMP | 13 | if BUILD_LOADER_BMP |
15 | if !EVAS_STATIC_BUILD_BMP | 14 | if !EVAS_STATIC_BUILD_BMP |
@@ -19,7 +18,7 @@ pkg_LTLIBRARIES = module.la | |||
19 | 18 | ||
20 | module_la_SOURCES = evas_image_load_bmp.c | 19 | module_la_SOURCES = evas_image_load_bmp.c |
21 | 20 | ||
22 | module_la_LIBADD = @EINA_LIBS@ @EVIL_LIBS@ $(top_builddir)/src/lib/libevas.la | 21 | module_la_LIBADD = @EINA_LIBS@ @EVIL_LIBS@ -lm $(top_builddir)/src/lib/libevas.la |
23 | module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version | 22 | module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version |
24 | module_la_LIBTOOLFLAGS = --tag=disable-static | 23 | module_la_LIBTOOLFLAGS = --tag=disable-static |
25 | 24 | ||
@@ -27,7 +26,7 @@ else | |||
27 | 26 | ||
28 | noinst_LTLIBRARIES = libevas_loader_bmp.la | 27 | noinst_LTLIBRARIES = libevas_loader_bmp.la |
29 | libevas_loader_bmp_la_SOURCES = evas_image_load_bmp.c | 28 | libevas_loader_bmp_la_SOURCES = evas_image_load_bmp.c |
30 | libevas_loader_bmp_la_LIBADD = | 29 | libevas_loader_bmp_la_LIBADD = |
31 | 30 | ||
32 | endif | 31 | endif |
33 | endif | 32 | endif |
diff --git a/libraries/evas/src/modules/loaders/bmp/Makefile.in b/libraries/evas/src/modules/loaders/bmp/Makefile.in index 943fb74..40600cc 100644 --- a/libraries/evas/src/modules/loaders/bmp/Makefile.in +++ b/libraries/evas/src/modules/loaders/bmp/Makefile.in | |||
@@ -181,6 +181,8 @@ EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ | |||
181 | EVIL_CFLAGS = @EVIL_CFLAGS@ | 181 | EVIL_CFLAGS = @EVIL_CFLAGS@ |
182 | EVIL_LIBS = @EVIL_LIBS@ | 182 | EVIL_LIBS = @EVIL_LIBS@ |
183 | EXEEXT = @EXEEXT@ | 183 | EXEEXT = @EXEEXT@ |
184 | EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ | ||
185 | EXOTIC_LIBS = @EXOTIC_LIBS@ | ||
184 | FGREP = @FGREP@ | 186 | FGREP = @FGREP@ |
185 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ | 187 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ |
186 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ | 188 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ |
@@ -231,6 +233,8 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 233 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 234 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 235 | PKG_CONFIG = @PKG_CONFIG@ |
236 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
237 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
234 | PNG_CFLAGS = @PNG_CFLAGS@ | 238 | PNG_CFLAGS = @PNG_CFLAGS@ |
235 | PNG_LIBS = @PNG_LIBS@ | 239 | PNG_LIBS = @PNG_LIBS@ |
236 | RANLIB = @RANLIB@ | 240 | RANLIB = @RANLIB@ |
@@ -249,8 +253,6 @@ VERSION = @VERSION@ | |||
249 | VMAJ = @VMAJ@ | 253 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | 254 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ |
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | 255 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ |
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | ||
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | ||
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 256 | XCB_CFLAGS = @XCB_CFLAGS@ |
255 | XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ | 257 | XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ |
256 | XCB_GL_LIBS = @XCB_GL_LIBS@ | 258 | XCB_GL_LIBS = @XCB_GL_LIBS@ |
@@ -324,8 +326,6 @@ evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ | |||
324 | evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ | 326 | evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ |
325 | evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ | 327 | evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ |
326 | evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ | 328 | evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ |
327 | evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@ | ||
328 | evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@ | ||
329 | evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | 329 | evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ |
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
@@ -416,13 +416,12 @@ AM_CPPFLAGS = \ | |||
416 | @FREETYPE_CFLAGS@ \ | 416 | @FREETYPE_CFLAGS@ \ |
417 | @PIXMAN_CFLAGS@ \ | 417 | @PIXMAN_CFLAGS@ \ |
418 | @EINA_CFLAGS@ \ | 418 | @EINA_CFLAGS@ \ |
419 | @EVIL_CFLAGS@ \ | 419 | @EVIL_CFLAGS@ |
420 | @WIN32_CPPFLAGS@ | ||
421 | 420 | ||
422 | @BUILD_LOADER_BMP_TRUE@@EVAS_STATIC_BUILD_BMP_FALSE@pkgdir = $(libdir)/evas/modules/loaders/bmp/$(MODULE_ARCH) | 421 | @BUILD_LOADER_BMP_TRUE@@EVAS_STATIC_BUILD_BMP_FALSE@pkgdir = $(libdir)/evas/modules/loaders/bmp/$(MODULE_ARCH) |
423 | @BUILD_LOADER_BMP_TRUE@@EVAS_STATIC_BUILD_BMP_FALSE@pkg_LTLIBRARIES = module.la | 422 | @BUILD_LOADER_BMP_TRUE@@EVAS_STATIC_BUILD_BMP_FALSE@pkg_LTLIBRARIES = module.la |
424 | @BUILD_LOADER_BMP_TRUE@@EVAS_STATIC_BUILD_BMP_FALSE@module_la_SOURCES = evas_image_load_bmp.c | 423 | @BUILD_LOADER_BMP_TRUE@@EVAS_STATIC_BUILD_BMP_FALSE@module_la_SOURCES = evas_image_load_bmp.c |
425 | @BUILD_LOADER_BMP_TRUE@@EVAS_STATIC_BUILD_BMP_FALSE@module_la_LIBADD = @EINA_LIBS@ @EVIL_LIBS@ $(top_builddir)/src/lib/libevas.la | 424 | @BUILD_LOADER_BMP_TRUE@@EVAS_STATIC_BUILD_BMP_FALSE@module_la_LIBADD = @EINA_LIBS@ @EVIL_LIBS@ -lm $(top_builddir)/src/lib/libevas.la |
426 | @BUILD_LOADER_BMP_TRUE@@EVAS_STATIC_BUILD_BMP_FALSE@module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version | 425 | @BUILD_LOADER_BMP_TRUE@@EVAS_STATIC_BUILD_BMP_FALSE@module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version |
427 | @BUILD_LOADER_BMP_TRUE@@EVAS_STATIC_BUILD_BMP_FALSE@module_la_LIBTOOLFLAGS = --tag=disable-static | 426 | @BUILD_LOADER_BMP_TRUE@@EVAS_STATIC_BUILD_BMP_FALSE@module_la_LIBTOOLFLAGS = --tag=disable-static |
428 | @BUILD_LOADER_BMP_TRUE@@EVAS_STATIC_BUILD_BMP_TRUE@noinst_LTLIBRARIES = libevas_loader_bmp.la | 427 | @BUILD_LOADER_BMP_TRUE@@EVAS_STATIC_BUILD_BMP_TRUE@noinst_LTLIBRARIES = libevas_loader_bmp.la |
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; |