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:


avoid loading all loaders if file doesn't exist

===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_image_load.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- evas_image_load.c   18 Sep 2006 09:40:28 -0000      1.35
+++ evas_image_load.c   18 Sep 2006 14:51:48 -0000      1.36
@@ -1,6 +1,10 @@
 #include "evas_common.h"
 #include "evas_private.h"
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
 extern Evas_List *evas_modules;
 
 EAPI RGBA_Image *
@@ -12,7 +16,8 @@
    char *p;
    char *loader = NULL;
    Evas_Module *em;
-
+   struct stat st;
+   
    if (file == NULL) return NULL;
 
    im = evas_common_image_find(file, key, 0, lo);
@@ -21,9 +26,11 @@
        evas_common_image_ref(im);
        return im;
      }
+   if (stat(file, &st) < 0) return NULL;
+   
    im = evas_common_image_new();
    if (!im) return NULL;
-
+   
    if (lo) im->load_opts = *lo;
    
    p = strrchr(file, '.');
@@ -100,6 +107,7 @@
    Evas_Image_Load_Func *evas_image_load_func = NULL;
    
    if (im->image->data) return;
+   if (!im->info.module) return;
 
    evas_image_load_func = im->info.loader;
    evas_module_use((Evas_Module *)im->info.module);



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to