forked from enlightenment/enlightenment
E -> Enlightenment_thumb -> Media -> Thumbnail Creation.
Summary: E -> Enlightenment_thumb -> Media -> Thumbnail Creation. @feature Add thumbnail creation to ethumb rather than in the image loaders. See: https://www.enlightenment.org/ss/display.php?image=e-58e93eef5e8b58.22514685.jpg Test Plan: View directory with mp4 video in efm and see thumbnail. Reviewers: zmike!, raster Reviewed By: raster Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D4779
This commit is contained in:
parent
1cbddb6d8f
commit
82f1b8a1c1
|
@ -504,7 +504,7 @@ src/bin/e_sha1.c \
|
|||
src/bin/e_thumb_main.c \
|
||||
src/bin/e_user.c
|
||||
|
||||
src_bin_enlightenment_thumb_LDADD = @E_THUMB_LIBS@
|
||||
src_bin_enlightenment_thumb_LDADD = @e_libs@
|
||||
src_bin_enlightenment_thumb_CPPFLAGS = $(E_CPPFLAGS)
|
||||
|
||||
src_bin_enlightenment_elm_cfgtool_SOURCES = \
|
||||
|
|
|
@ -28,6 +28,7 @@ void *alloca(size_t);
|
|||
#include <Evas.h>
|
||||
#include <Eet.h>
|
||||
#include <Edje.h>
|
||||
#include <Emotion.h>
|
||||
#include "e_sha1.h"
|
||||
#include "e_user.h"
|
||||
|
||||
|
@ -110,6 +111,7 @@ main(int argc,
|
|||
edje_init();
|
||||
ecore_file_init();
|
||||
ecore_ipc_init();
|
||||
emotion_init();
|
||||
|
||||
e_user_dir_concat_static(_thumbdir, "fileman/thumbnails");
|
||||
ecore_file_mkpath(_thumbdir);
|
||||
|
@ -122,6 +124,7 @@ main(int argc,
|
|||
_e_ipc_server = NULL;
|
||||
}
|
||||
|
||||
emotion_shutdown();
|
||||
ecore_ipc_shutdown();
|
||||
ecore_file_shutdown();
|
||||
ecore_evas_shutdown();
|
||||
|
@ -363,6 +366,31 @@ _e_thumb_generate(E_Thumb *eth)
|
|||
|
||||
sortkey = EINA_FALSE;
|
||||
|
||||
if ((ext) &&
|
||||
((!strcasecmp(ext, ".mp4")) ||
|
||||
(!strcasecmp(ext, ".m4a")) ||
|
||||
(!strcasecmp(ext, ".mp3"))
|
||||
))
|
||||
{
|
||||
Evas_Object *em;
|
||||
|
||||
em = emotion_object_add(evas);
|
||||
emotion_object_init(em, NULL);
|
||||
emotion_object_file_set(em, eth->file);
|
||||
|
||||
im = emotion_file_meta_artwork_get(em, eth->file, EMOTION_ARTWORK_PREVIEW_IMAGE);
|
||||
if (!im) im = emotion_file_meta_artwork_get(em, eth->file, EMOTION_ARTWORK_IMAGE);
|
||||
if (im)
|
||||
{
|
||||
evas_object_image_size_get(im, &ww, &hh);
|
||||
evas_object_image_fill_set(im, 0, 0, ww, hh);
|
||||
evas_object_move(im, 0, 0);
|
||||
evas_object_resize(im, ww, hh);
|
||||
}
|
||||
evas_object_del(em);
|
||||
if (im) goto process;
|
||||
}
|
||||
|
||||
if ((ext) && (eth->key) &&
|
||||
((!strcasecmp(ext, ".edj")) ||
|
||||
(!strcasecmp(ext, ".eap"))))
|
||||
|
@ -506,6 +534,7 @@ _e_thumb_generate(E_Thumb *eth)
|
|||
else
|
||||
goto end;
|
||||
|
||||
process:
|
||||
ecore_evas_alpha_set(ee, alpha);
|
||||
ecore_evas_resize(ee, ww, hh);
|
||||
evas_object_show(im);
|
||||
|
|
Loading…
Reference in New Issue