sanjeev pushed a commit to branch master.

http://git.enlightenment.org/apps/ephoto.git/commit/?id=4fc8cedccbe0f8c212de46fd9ce05cfe877d304d

commit 4fc8cedccbe0f8c212de46fd9ce05cfe877d304d
Author: Sanjeev BA <as290...@samsung.com>
Date:   Tue Aug 5 08:55:49 2014 +0900

    Add filters at application level.
    
    Signed-off-by: Sanjeev BA <as290...@samsung.com>
---
 src/bin/ephoto.h | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/bin/ephoto.h b/src/bin/ephoto.h
index 04e5530..8c99d5c 100644
--- a/src/bin/ephoto.h
+++ b/src/bin/ephoto.h
@@ -163,14 +163,29 @@ extern int __log_domain;
 static inline Eina_Bool
 _ephoto_eina_file_direct_info_image_useful(const Eina_File_Direct_Info *info)
 {
-   const char /* *type, */ *bname;
+   const char *type, *bname;
+   int i = 0;
+
+   const char *filters[] =
+   {
+     "png", "jpeg", "eet", "xpm", "tiff", "gif", "svg", "webp", "pmaps",
+     "bmp", "tga", "wbmp", "ico", "psd", "jp2k", "generic"
+   };
 
    bname = info->path + info->name_start;
    if (bname[0] == '.') return EINA_FALSE;
    if ((info->type != EINA_FILE_REG) && (info->type != EINA_FILE_UNKNOWN))
      return EINA_FALSE;
 
-   return evas_object_image_extension_can_load_get(bname);
+   type = strchr(bname, '.');
+   if(!type) return EINA_FALSE;
+   int count = sizeof(filters)/sizeof(filters[0]);
+   for (i=0; i < count; i++)
+     {
+        if (!strcmp(type+1, filters[i]))
+          return evas_object_image_extension_can_load_get(bname);
+     }
+   return EINA_FALSE;
    /* seems that this does not play nice with threads */
    //if (!(type = efreet_mime_type_get(info->path))) return EINA_FALSE;
    //return strncmp(type, "image/", sizeof("image/") - 1) == 0;

-- 


Reply via email to