void *map = NULL;
size_t position = 0;
char hasa = 0;
- int w = 0, h = 0, planes = 0, bit_count = 0,
- image_size = 0, comp = 0, hdpi = 0, vdpi = 0,
- palette_size = -1, important_colors = 0;
- unsigned int offset, head_size, rmask = 0, gmask = 0, bmask = 0, amask = 0;
- unsigned int pal_num = 0;
- int right_way_up = 0;
+ int w = 0, h = 0, bit_count = 0, image_size = 0, comp = 0;
+ unsigned int offset, head_size, amask = 0;
int fsize = 0;
unsigned int bmpsize;
unsigned short res1, res2;
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
h = tmp; // height
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
- planes = tmp; // must be 1
+ //planes = tmp; // must be 1
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
bit_count = tmp; // bits per pixel: 1, 4, 8 & 24
}
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
h = tmp2; // height
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
- planes = tmp; // must be 1
+ //planes = tmp; // must be 1
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
image_size = tmp2; // bitmap data size
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
+ //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
+ //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
+ //palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- important_colors = tmp2; // number of important colors - 0 if all
+ //important_colors = tmp2; // number of important colors - 0 if all
if (!read_skip(fsize, &position, 24)) goto close_file; // skip unused header
if (image_size == 0) image_size = fsize - offset;
}
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
h = tmp2; // height
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
- planes = tmp; // must be 1
+ //planes = tmp; // must be 1
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
image_size = tmp2; // bitmap data size
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
+ //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
+ //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
+ //palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- important_colors = tmp2; // number of important colors - 0 if all
+ //important_colors = tmp2; // number of important colors - 0 if all
if (image_size == 0) image_size = fsize - offset;
if ((comp == 0) && (bit_count == 32)) hasa = 1; // GIMP seems to store it this way
}
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
h = tmp2; // height
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
- planes = tmp; // must be 1
+ //planes = tmp; // must be 1
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
image_size = tmp2; // bitmap data size
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
+ //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
+ //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
+ //palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- important_colors = tmp2; // number of important colors - 0 if all
+ //important_colors = tmp2; // number of important colors - 0 if all
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- rmask = tmp2; // red mask
+ //rmask = tmp2; // red mask
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- gmask = tmp2; // green mask
+ //gmask = tmp2; // green mask
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- bmask = tmp2; // blue mask
+ //bmask = tmp2; // blue mask
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
amask = tmp2; // alpha mask
if (!read_skip(fsize, &position, 36)) goto close_file; // skip unused cie
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
h = tmp2; // height
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
- planes = tmp; // must be 1
+ //planes = tmp; // must be 1
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
comp = tmp2; // compression method
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- image_size = tmp2; // bitmap data size
+ //image_size = tmp2; // bitmap data size
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
+ //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
+ //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
+ //palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- important_colors = tmp2; // number of important colors - 0 if all
+ //important_colors = tmp2; // number of important colors - 0 if all
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- rmask = tmp2; // red mask
+ //rmask = tmp2; // red mask
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- gmask = tmp2; // green mask
+ //gmask = tmp2; // green mask
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- bmask = tmp2; // blue mask
+ //bmask = tmp2; // blue mask
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
amask = tmp2; // alpha mask
if (!read_skip(fsize, &position, 36)) goto close_file; // skip unused cie
if (h < 0)
{
h = -h;
- right_way_up = 1;
+ //right_way_up = 1;
}
if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) ||
if (bit_count < 16)
{
- if ((palette_size < 0) || (palette_size > 256)) pal_num = 256;
- else pal_num = palette_size;
+ //if ((palette_size < 0) || (palette_size > 256)) pal_num = 256;
+ //else pal_num = palette_size;
if (bit_count == 1)
{
if (comp == 0) // no compression
size_t position = 0;
unsigned char *buffer = NULL, *buffer_end = NULL, *p;
char hasa = 0;
- int x = 0, y = 0, w = 0, h = 0, planes = 0, bit_count = 0, image_size = 0,
- comp = 0, hdpi = 0, vdpi = 0, palette_size = -1, important_colors = 0;
+ int x = 0, y = 0, w = 0, h = 0, bit_count = 0, image_size = 0,
+ comp = 0, palette_size = -1;
unsigned int offset = 0, head_size = 0;
unsigned int *pal = NULL, pal_num = 0, *pix = NULL, *surface = NULL, fix,
rmask = 0, gmask = 0, bmask = 0, amask = 0;
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
h = tmp; // height
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
- planes = tmp; // must be 1
+ //planes = tmp; // must be 1
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
bit_count = tmp; // bits per pixel: 1, 4, 8 & 24
}
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
h = tmp2; // height
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
- planes = tmp; // must be 1
+ //planes = tmp; // must be 1
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
image_size = tmp2; // bitmap data size
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
+ //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
+ //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- important_colors = tmp2; // number of important colors - 0 if all
+ //important_colors = tmp2; // number of important colors - 0 if all
if (!read_skip(fsize, &position, 24)) goto close_file; // skip unused header
if (image_size == 0) image_size = fsize - offset;
}
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
h = tmp2; // height
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
- planes = tmp; // must be 1
+ //planes = tmp; // must be 1
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
image_size = tmp2; // bitmap data size
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
+ //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
+ //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- important_colors = tmp2; // number of important colors - 0 if all
+ //important_colors = tmp2; // number of important colors - 0 if all
if (image_size == 0) image_size = fsize - offset;
if ((comp == 0) && (bit_count == 32)) hasa = 1; // GIMP seems to store it this way
}
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
h = tmp2; // height
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
- planes = tmp; // must be 1
+ //planes = tmp; // must be 1
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
image_size = tmp2; // bitmap data size
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
+ //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
+ //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- important_colors = tmp2; // number of important colors - 0 if all
+ //important_colors = tmp2; // number of important colors - 0 if all
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
rmask = tmp2; // red mask
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
h = tmp2; // height
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
- planes = tmp; // must be 1
+ //planes = tmp; // must be 1
if (!read_short(map, fsize, &position, &tmp)) goto close_file;
bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
image_size = tmp2; // bitmap data size
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
+ //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
+ //vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8)
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
- important_colors = tmp2; // number of important colors - 0 if all
+ //important_colors = tmp2; // number of important colors - 0 if all
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
rmask = tmp2; // red mask
if (!read_int(map, fsize, &position, &tmp2)) goto close_file;
unsigned short word;
unsigned char byte;
int wanted_w = 0, wanted_h = 0, w, h, cols, i, planes = 0,
- hot_x = 0, hot_y = 0, bpp = 0, pdelta, search = -1, have_choice = 0,
+ bpp = 0, pdelta, search = -1, have_choice = 0,
hasa = 1;
unsigned int bmoffset, bmsize, fsize;
unsigned short reserved, type, count;
if (!read_uchar(map, fsize, &position, &byte)) goto close_file;
if (!read_ushort(map, fsize, &position, &word)) goto close_file;
if (type == CURSOR) planes = word;
- else hot_x = word;
+ //else hot_x = word;
if (!read_ushort(map, fsize, &position, &word)) goto close_file;
if (type == CURSOR) bpp = word;
- else hot_y = word;
+ //else hot_y = word;
if (!read_uint(map, fsize, &position, &bmsize)) goto close_file;
if (!read_uint(map, fsize, &position, &bmoffset)) goto close_file;
if ((bmsize <= 0) || (bmoffset <= 0) || (bmoffset >= fsize)) goto close_file;
unsigned char byte;
unsigned int dword;
int wanted_w = 0, wanted_h = 0, w, h, cols, i, planes = 0,
- hot_x = 0, hot_y = 0, bpp = 0, pdelta, search = -1, have_choice = 0,
+ bpp = 0, pdelta, search = -1, have_choice = 0,
stride, pstride, j, right_way_up = 0, diff_size = 0, cols2;
- unsigned int bmoffset, bmsize, bitcount, compression, imagesize, fsize,
- colorsused, colorsimportant, *pal, *surface, *pix, none_zero_alpha = 0;
- unsigned short reserved, type, count, planes2;
+ unsigned int bmoffset, bmsize, bitcount, fsize,
+ *pal, *surface, *pix, none_zero_alpha = 0;
+ unsigned short reserved, type, count;
unsigned char *maskbuf, *pixbuf, *p;
struct {
int pdelta;
if (!read_uchar(map, fsize, &position, &byte)) goto close_file;
if (!read_ushort(map, fsize, &position, &word)) goto close_file;
if (type == 1) planes = word;
- else hot_x = word;
+ //else hot_x = word;
if (!read_ushort(map, fsize, &position, &word)) goto close_file;
if (type == 1) bpp = word;
- else hot_y = word;
+ //else hot_y = word;
if (!read_uint(map, fsize, &position, &bmsize)) goto close_file;
if (!read_uint(map, fsize, &position, &bmoffset)) goto close_file;
if ((bmsize <= 0) || (bmoffset <= 0) || (bmoffset >= fsize)) goto close_file;
file, ie->w, ie->h, w, h);
}
if (!read_ushort(map, fsize, &position, &word)) goto close_file; // planes
- planes2 = word;
+ //planes2 = word;
if (!read_ushort(map, fsize, &position, &word)) goto close_file; // bitcount
bitcount = word;
if (!read_uint(map, fsize, &position, &dword)) goto close_file; // compression
- compression = dword;
+ //compression = dword;
if (!read_uint(map, fsize, &position, &dword)) goto close_file; // imagesize
- imagesize = dword;
+ //imagesize = dword;
if (!read_uint(map, fsize, &position, &dword)) goto close_file; // z pixels per m
if (!read_uint(map, fsize, &position, &dword)) goto close_file; // y pizels per m
if (!read_uint(map, fsize, &position, &dword)) goto close_file; // colors used
- colorsused = dword;
+ //colorsused = dword;
if (!read_uint(map, fsize, &position, &dword)) goto close_file; // colors important
- colorsimportant = dword;
+ //colorsimportant = dword;
evas_cache_image_surface_alloc(ie, ie->w, ie->h);
surface = evas_cache_image_pixels(ie);