SVN revision: 64389
This commit is contained in:
Carsten Haitzler 2011-10-25 12:20:53 +00:00
parent a75ecced08
commit d7c699670e
1 changed files with 17 additions and 15 deletions

View File

@ -503,10 +503,9 @@ evas_image_load_file_data_jpeg_internal(Image_Entry *ie,
struct jpeg_decompress_struct cinfo; struct jpeg_decompress_struct cinfo;
struct _JPEG_error_mgr jerr; struct _JPEG_error_mgr jerr;
DATA8 *ptr, *line[16], *data; DATA8 *ptr, *line[16], *data;
DATA32 *ptr2, *ptr_rotate; DATA32 *ptr2, *ptr_rotate = NULL;
unsigned int x, y, l, i, scans; unsigned int x, y, l, i, scans;
int region = 0; int region = 0;
/* rotation setting */ /* rotation setting */
unsigned int tmp; unsigned int tmp;
unsigned int load_region_x = 0, load_region_y = 0; unsigned int load_region_x = 0, load_region_y = 0;
@ -686,7 +685,7 @@ evas_image_load_file_data_jpeg_internal(Image_Entry *ie,
ptr_rotate = ptr2; ptr_rotate = ptr2;
} }
else else
ptr2 = evas_cache_image_pixels(ie); ptr2 = evas_cache_image_pixels(ie);
if (!ptr2) if (!ptr2)
{ {
@ -1000,16 +999,17 @@ done:
data2--; data2--;
} }
} }
else else
{ {
data2 = ptr_rotate; data2 = NULL;
to = NULL;
if (ptr_rotate) data2 = ptr_rotate;
if (degree == 90) if (degree == 90)
{ {
to = data1 + w - 1; to = data1 + w - 1;
hw = -hw - 1; hw = -hw - 1;
} }
else if (degree == 270) else if (degree == 270)
{ {
to = data1 + hw - w; to = data1 + hw - w;
@ -1017,25 +1017,27 @@ done:
hw = hw + 1; hw = hw + 1;
} }
from = data2; if (to)
for (x = ie->w; --x >= 0;)
{ {
for (y =ie->h; --y >= 0;) from = data2;
for (x = ie->w; --x >= 0;)
{ {
*to = *from; for (y =ie->h; --y >= 0;)
from++; {
to += w; *to = *from;
from++;
to += w;
}
to += hw;
} }
to += hw;
} }
if (ptr_rotate) if (ptr_rotate)
{ {
free(ptr_rotate); free(ptr_rotate);
ptr_rotate = NULL; ptr_rotate = NULL;
} }
} }
if (region ) if (region)
{ {
ie->load_opts.region.x = load_region_x; ie->load_opts.region.x = load_region_x;
ie->load_opts.region.y = load_region_y; ie->load_opts.region.y = load_region_y;