forked from enlightenment/efl
eet image load logic was reversed! it worked anwyay - just nto as
effiectively as it could have :) SVN revision: 13943
This commit is contained in:
parent
feb36e23b7
commit
db7df4cc4a
|
@ -563,12 +563,50 @@ load_image_file_data_jpeg(RGBA_Image *im, const char *file, const char *key)
|
||||||
static int load_image_file_head_eet(RGBA_Image *im, const char *file, const char *key);
|
static int load_image_file_head_eet(RGBA_Image *im, const char *file, const char *key);
|
||||||
static int
|
static int
|
||||||
load_image_file_head_eet(RGBA_Image *im, const char *file, const char *key)
|
load_image_file_head_eet(RGBA_Image *im, const char *file, const char *key)
|
||||||
|
{
|
||||||
|
int w, h, alpha, compression, quality, lossy;
|
||||||
|
Eet_File *ef;
|
||||||
|
int ok;
|
||||||
|
|
||||||
|
if ((!file) || (!key)) return -1;
|
||||||
|
ef = eet_open((char *)file, EET_FILE_MODE_READ);
|
||||||
|
if (!ef) return -1;
|
||||||
|
ok = eet_data_image_header_read(ef, (char *)key,
|
||||||
|
&w, &h, &alpha, &compression, &quality, &lossy);
|
||||||
|
if (!ok)
|
||||||
|
{
|
||||||
|
eet_close(ef);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if ((w > 8192) || (h > 8192))
|
||||||
|
{
|
||||||
|
eet_close(ef);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (alpha) im->flags |= RGBA_IMAGE_HAS_ALPHA;
|
||||||
|
if (!im->image)
|
||||||
|
im->image = evas_common_image_surface_new(im);
|
||||||
|
if (!im->image)
|
||||||
|
{
|
||||||
|
eet_close(ef);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
im->image->w = w;
|
||||||
|
im->image->h = h;
|
||||||
|
eet_close(ef);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int load_image_file_data_eet(RGBA_Image *im, const char *file, const char *key);
|
||||||
|
static int
|
||||||
|
load_image_file_data_eet(RGBA_Image *im, const char *file, const char *key)
|
||||||
{
|
{
|
||||||
int w, h, alpha, compression, quality, lossy;
|
int w, h, alpha, compression, quality, lossy;
|
||||||
Eet_File *ef;
|
Eet_File *ef;
|
||||||
DATA32 *body;
|
DATA32 *body;
|
||||||
|
|
||||||
if ((!file) || (!key)) return -1;
|
if ((!file) || (!key)) return -1;
|
||||||
|
if ((im->image) && (im->image->data)) return 1;
|
||||||
ef = eet_open((char *)file, EET_FILE_MODE_READ);
|
ef = eet_open((char *)file, EET_FILE_MODE_READ);
|
||||||
if (!ef) return -1;
|
if (!ef) return -1;
|
||||||
body = eet_data_image_read(ef, (char *)key,
|
body = eet_data_image_read(ef, (char *)key,
|
||||||
|
@ -600,43 +638,6 @@ load_image_file_head_eet(RGBA_Image *im, const char *file, const char *key)
|
||||||
eet_close(ef);
|
eet_close(ef);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int load_image_file_data_eet(RGBA_Image *im, const char *file, const char *key);
|
|
||||||
static int
|
|
||||||
load_image_file_data_eet(RGBA_Image *im, const char *file, const char *key)
|
|
||||||
{
|
|
||||||
int w, h, alpha, compression, quality, lossy;
|
|
||||||
Eet_File *ef;
|
|
||||||
int ok;
|
|
||||||
|
|
||||||
if ((!file) || (!key)) return -1;
|
|
||||||
ef = eet_open((char *)file, EET_FILE_MODE_READ);
|
|
||||||
if (!ef) return -1;
|
|
||||||
ok = eet_data_image_header_read(ef, (char *)key,
|
|
||||||
&w, &h, &alpha, &compression, &quality, &lossy);
|
|
||||||
if (!ok)
|
|
||||||
{
|
|
||||||
eet_close(ef);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if ((w > 8192) || (h > 8192))
|
|
||||||
{
|
|
||||||
eet_close(ef);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (alpha) im->flags |= RGBA_IMAGE_HAS_ALPHA;
|
|
||||||
if (!im->image)
|
|
||||||
im->image = evas_common_image_surface_new(im);
|
|
||||||
if (!im->image)
|
|
||||||
{
|
|
||||||
eet_close(ef);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
im->image->w = w;
|
|
||||||
im->image->h = h;
|
|
||||||
eet_close(ef);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BUILD_LOADER_EDB
|
#ifdef BUILD_LOADER_EDB
|
||||||
|
|
Loading…
Reference in New Issue