forked from enlightenment/ephoto
Do not load non-image files in ephoto. Fix for https://phab.enlightenment.org/T802
Summary: ephoto uses evas_common_extension_can_load_get() to determine whether a certain type of file should be displayed or not. mp3, mp4, ogg etc can be loaded by evas. There is already code in ephoto to enable "mime" type based loading of files - commented because efreet crashed in multi thread case. We should enable that code and fix issues in efreet. Reviewers: raster Differential Revision: https://phab.enlightenment.org/D1257
This commit is contained in:
parent
2688fcedfa
commit
9cae696fab
|
@ -163,17 +163,17 @@ 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;
|
||||
|
||||
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);
|
||||
//return evas_object_image_extension_can_load_get(bname);
|
||||
/* 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;
|
||||
if (!(type = efreet_mime_type_get(info->path))) return EINA_FALSE;
|
||||
return strncmp(type, "image/", sizeof("image/") - 1) == 0;
|
||||
}
|
||||
|
||||
extern int EPHOTO_EVENT_ENTRY_CREATE;
|
||||
|
|
Loading…
Reference in New Issue