Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/lib/engines/common
Modified Files:
evas_image_load.c
Log Message:
eet image load logic was reversed! it worked anwyay - just nto as
effiectively as it could have :)
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_image_load.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- evas_image_load.c 26 Jan 2005 07:49:56 -0000 1.16
+++ evas_image_load.c 28 Mar 2005 03:41:22 -0000 1.17
@@ -566,21 +566,20 @@
{
int w, h, alpha, compression, quality, lossy;
Eet_File *ef;
- DATA32 *body;
+ int ok;
if ((!file) || (!key)) return -1;
ef = eet_open((char *)file, EET_FILE_MODE_READ);
if (!ef) return -1;
- body = eet_data_image_read(ef, (char *)key,
- &w, &h, &alpha, &compression, &quality, &lossy);
- if (!body)
+ 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))
{
- free(body);
eet_close(ef);
return -1;
}
@@ -589,14 +588,11 @@
im->image = evas_common_image_surface_new(im);
if (!im->image)
{
- free(body);
eet_close(ef);
return -1;
}
im->image->w = w;
im->image->h = h;
- im->image->data = body;
- im->image->no_free = 0;
eet_close(ef);
return 1;
}
@@ -607,20 +603,22 @@
{
int w, h, alpha, compression, quality, lossy;
Eet_File *ef;
- int ok;
+ DATA32 *body;
if ((!file) || (!key)) return -1;
+ if ((im->image) && (im->image->data)) 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)
+ body = eet_data_image_read(ef, (char *)key,
+ &w, &h, &alpha, &compression, &quality, &lossy);
+ if (!body)
{
eet_close(ef);
return -1;
}
if ((w > 8192) || (h > 8192))
{
+ free(body);
eet_close(ef);
return -1;
}
@@ -629,11 +627,14 @@
im->image = evas_common_image_surface_new(im);
if (!im->image)
{
+ free(body);
eet_close(ef);
return -1;
}
im->image->w = w;
im->image->h = h;
+ im->image->data = body;
+ im->image->no_free = 0;
eet_close(ef);
return 1;
}
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs