This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository efm2.

View the commit online.

commit 235864ae16a70e7e2048f3f685d7ea126e4b51f3
Author: Carsten Haitzler (Rasterman) <[email protected]>
AuthorDate: Thu Mar 26 10:34:24 2026 +0000

    thumb - use emotion artwork before online search if there
---
 src/backends/default/thumb_music.c | 35 ++++++++++++++++++++++++++++++++---
 1 file changed, 32 insertions(+), 3 deletions(-)

diff --git a/src/backends/default/thumb_music.c b/src/backends/default/thumb_music.c
index e126f7d..3f1cfc5 100644
--- a/src/backends/default/thumb_music.c
+++ b/src/backends/default/thumb_music.c
@@ -6,8 +6,9 @@
 // halve to 256 then halve it to 128 etc. rather than render from orig to
 // target size....
 
-static Evas_Object *im    = NULL;
-static Eina_Bool    alpha = EINA_FALSE;
+static Evas_Object *im      = NULL;
+static Evas_Object *artwork = NULL;
+static Eina_Bool    alpha   = EINA_FALSE;
 static int          iw = 0, ih = 0;
 
 static Eina_List *results = NULL;
@@ -61,7 +62,7 @@ static void
 _cb_vid_open_done(void *data EINA_UNUSED, Evas_Object *obj,
                   void *event EINA_UNUSED)
 { // we finished opening - get netadata
-  const char *s;
+  const char *s, *path;
 
   s = emotion_object_meta_info_get(obj, EMOTION_META_INFO_TRACK_TITLE);
   if (s) title = strdup(s);
@@ -69,6 +70,26 @@ _cb_vid_open_done(void *data EINA_UNUSED, Evas_Object *obj,
   if (s) artist = strdup(s);
   s = emotion_object_meta_info_get(obj, EMOTION_META_INFO_TRACK_ALBUM);
   if (s) album = strdup(s);
+  path = emotion_object_file_get(obj);
+  if (path)
+    {
+      Evas_Object *o = emotion_file_meta_artwork_get(obj, path,
+                                                     EMOTION_ARTWORK_IMAGE);
+      if (!o) o = emotion_file_meta_artwork_get(obj, path,
+                                                EMOTION_ARTWORK_PREVIEW_IMAGE);
+      if (o)
+        { // file has embedded artwork
+          int w, h;
+
+          evas_object_image_size_get(o, &w, &h);
+          if ((w > 0) && (h > 0))
+            { // be sure it's a filled image and store it for later
+              evas_object_image_filled_set(o, EINA_TRUE);
+              artwork = o;
+            }
+          else evas_object_del(o);
+        }
+    }
   // finish loop
   elm_exit();
 }
@@ -350,6 +371,14 @@ thumb_music(Eet_File *ef, const char *path, const char *mime EINA_UNUSED,
 
   // if we didn't find an explicit matching thumb path in dir or nearby...
   if (thumb_file) _thumb_image_file_set(thumb_file);
+  else
+    { // use video artwork object as our album art thumbnail
+      evas_object_del(im); // don't need the old one
+      im = artwork; // new one
+      artwork = NULL;
+      evas_object_image_size_get(im, &iw, &ih);
+      alpha = evas_object_image_alpha_get(im);
+    }
   // explicit thumb not found or the load failed as image size is not sane
   if ((iw <= 0) || (ih < 0)) _thumb_online_search(path);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to