*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
return EINA_FALSE;
}
-
- degree = 0;
- change_wh = EINA_FALSE;
- jpeg_create_decompress(&cinfo);
+ jpeg_create_decompress(&cinfo);
if (_evas_jpeg_membuf_src(&cinfo, map, length))
{
unsigned int x, y, l, i, scans;
int region = 0;
/* rotation setting */
- unsigned int tmp;
+ unsigned int ie_w = 0, ie_h = 0;
unsigned int load_region_x = 0, load_region_y = 0;
unsigned int load_region_w = 0, load_region_h = 0;
volatile int degree = 0;
if (change_wh)
{
- tmp = ie->w;
- ie->w = ie->h;
- ie->h = tmp;
+ ie_w = ie->h;
+ ie_h = ie->w;
+ }
+ else
+ {
+ ie_w = ie->w;
+ ie_h = ie->h;
}
if ((ie->load_opts.region.w > 0) && (ie->load_opts.region.h > 0))
cinfo.region_h = ie->load_opts.region.h;
#endif
}
- if ((!region) && ((w != ie->w) || (h != ie->h)))
+ if ((!region) && ((w != ie_w) || (h != ie_h)))
{
- // race condition, the file could have change from when we call header
- // this test will not solve the problem with region code.
- jpeg_destroy_decompress(&cinfo);
+ // race condition, the file could have change from when we call header
+ // this test will not solve the problem with region code.
+ jpeg_destroy_decompress(&cinfo);
_evas_jpeg_membuf_src_term(&cinfo);
- *error = EVAS_LOAD_ERROR_GENERIC;
- return EINA_FALSE;
+ *error = EVAS_LOAD_ERROR_GENERIC;
+ return EINA_FALSE;
}
if ((region) &&
- ((ie->w != ie->load_opts.region.w) || (ie->h != ie->load_opts.region.h)))
+ ((ie_w != ie->load_opts.region.w) || (ie_h != ie->load_opts.region.h)))
{
- ie->w = ie->load_opts.region.w;
- ie->h = ie->load_opts.region.h;
+ ie_w = ie->load_opts.region.w;
+ ie_h = ie->load_opts.region.h;
+ if (change_wh)
+ {
+ ie->w = ie_h;
+ ie->h = ie_w;
+ }
+ else
+ {
+ ie->w = ie_w;
+ ie->h = ie_h;
+ }
+
}
if (!(((cinfo.out_color_space == JCS_RGB) &&
DATA32 *data1, *data2, *to, *from;
int lx, ly, lw, lh, hw;
- if (change_wh)
- {
- tmp = ie->w;
- ie->w = ie->h;
- ie->h = tmp;
- }
-
lw = ie->w;
lh = ie->h;
hw =lw * lh;
ie->load_opts.region.h = load_region_h;
}
}
+
if (line_done)
{
jpeg_destroy_decompress(&cinfo);