kwo pushed a commit to branch master.

http://git.enlightenment.org/legacy/imlib2.git/commit/?id=05f454a89d7aa4dd7e9169a90552c29f70821969

commit 05f454a89d7aa4dd7e9169a90552c29f70821969
Author: Kim Woelders <[email protected]>
Date:   Fri Mar 11 13:51:07 2022 +0100

    Introduce __imlib_GetKey()
---
 src/lib/image.c                  | 6 ++++++
 src/lib/image.h                  | 2 ++
 src/modules/loaders/loader_id3.c | 6 ++++--
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/lib/image.c b/src/lib/image.c
index ce18ea6..46e90ae 100644
--- a/src/lib/image.c
+++ b/src/lib/image.c
@@ -754,6 +754,12 @@ __imlib_DirtyImage(ImlibImage * im)
 #endif
 }
 
+__EXPORT__ const char *
+__imlib_GetKey(const ImlibImage * im)
+{
+   return im->key;
+}
+
 void
 __imlib_SaveImage(ImlibImage * im, const char *file,
                   ImlibProgressFunction progress, char progress_granularity,
diff --git a/src/lib/image.h b/src/lib/image.h
index 201c15d..f4f16c1 100644
--- a/src/lib/image.h
+++ b/src/lib/image.h
@@ -100,6 +100,8 @@ int                 __imlib_LoadProgress(ImlibImage * im,
 int                 __imlib_LoadProgressRows(ImlibImage * im,
                                              int row, int nrows);
 
+const char         *__imlib_GetKey(const ImlibImage * im);
+
 void                __imlib_AttachTag(ImlibImage * im, const char *key,
                                       int val, void *data,
                                       ImlibDataDestructorFunction destructor);
diff --git a/src/modules/loaders/loader_id3.c b/src/modules/loaders/loader_id3.c
index d214839..a432265 100644
--- a/src/modules/loaders/loader_id3.c
+++ b/src/modules/loaders/loader_id3.c
@@ -239,10 +239,12 @@ get_options(lopt * opt, const ImlibImage * im)
 {
    unsigned int        handle = 0, index = 0, traverse = 0;
    context            *ctx;
+   const char         *str;
 
-   if (im->key)
+   str = __imlib_GetKey(im);
+   if (str)
      {
-        char               *key = strdup(im->key);
+        char               *key = strdup(str);
         char               *tok = strtok(key, ",");
 
         traverse = 0;

-- 


Reply via email to