forked from enlightenment/efl
From: Jeonghyun Yun <jh0506.yun@samsung.com>
Subject: Re: [E-devel] [Patch] evas_image_load_bmp small patch When I tested some bmp files on evas, I found one bmp file is not displayed. But this bmp file is displayed on windows and linux gimp and etc. So I checked this bmp file, this file have 208 data per line despite 207 pixel per line!! I fixed code to skip the data when data is more than width instead of break. I think this is not bug but evas policy problem. SVN revision: 57076
This commit is contained in:
parent
d704222f1c
commit
2c428c4c15
|
@ -93,3 +93,9 @@
|
||||||
transition.
|
transition.
|
||||||
* A lot of textblock speed improvements and reduced memory footprint.
|
* A lot of textblock speed improvements and reduced memory footprint.
|
||||||
|
|
||||||
|
2011-02-16 Jeonghyun Yun
|
||||||
|
|
||||||
|
* Patch from Jeonghyun Yun <jh0506.yun@samsung.com> that
|
||||||
|
improves BMP loader support to handle malformed RLE BMP's that
|
||||||
|
encode more pixels per line than the image actuall has.
|
||||||
|
|
||||||
|
|
|
@ -681,32 +681,34 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
|
||||||
{
|
{
|
||||||
if (p[0])
|
if (p[0])
|
||||||
{
|
{
|
||||||
unsigned int col1 = pal[p[1] >> 4];
|
if ((x + p[0]) <= wpad)
|
||||||
unsigned int col2 = pal[p[1] & 0xf];
|
{
|
||||||
|
unsigned int col1 = pal[p[1] >> 4];
|
||||||
|
unsigned int col2 = pal[p[1] & 0xf];
|
||||||
|
|
||||||
if ((x + p[0]) > wpad) break;
|
count = p[0] / 2;
|
||||||
count = p[0] / 2;
|
while (count > 0)
|
||||||
while (count > 0)
|
|
||||||
{
|
|
||||||
if (x < w)
|
|
||||||
{
|
{
|
||||||
pix[0] = col1;
|
if (x < w)
|
||||||
x++;
|
{
|
||||||
|
pix[0] = col1;
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
if (x < w)
|
||||||
|
{
|
||||||
|
pix[1] = col2;
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
pix += 2;
|
||||||
|
count--;
|
||||||
}
|
}
|
||||||
if (x < w)
|
if (p[0] & 0x1)
|
||||||
{
|
{
|
||||||
pix[1] = col2;
|
*pix = col1;
|
||||||
x++;
|
x++;
|
||||||
|
pix++;
|
||||||
}
|
}
|
||||||
pix += 2;
|
}
|
||||||
count--;
|
|
||||||
}
|
|
||||||
if (p[0] & 0x1)
|
|
||||||
{
|
|
||||||
*pix = col1;
|
|
||||||
x++;
|
|
||||||
pix++;
|
|
||||||
}
|
|
||||||
p += 2;
|
p += 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -809,17 +811,19 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
|
||||||
{
|
{
|
||||||
if (p[0])
|
if (p[0])
|
||||||
{
|
{
|
||||||
unsigned int col = pal[p[1]];
|
if ((x + p[0]) <= w)
|
||||||
|
{
|
||||||
|
unsigned int col = pal[p[1]];
|
||||||
|
|
||||||
count = p[0];
|
count = p[0];
|
||||||
if ((x + p[0]) > w) break;
|
while (count > 0)
|
||||||
while (count > 0)
|
{
|
||||||
{
|
*pix = col;
|
||||||
*pix = col;
|
pix++;
|
||||||
pix++;
|
count--;
|
||||||
count--;
|
}
|
||||||
}
|
x += p[0];
|
||||||
x += p[0];
|
}
|
||||||
p += 2;
|
p += 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue