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

git pushed a commit to branch master
in repository legacy-imlib2.

View the commit online.

commit cd4f0c0419195eb78978419a5546de15bbaa8817
Author: NRK <[email protected]>
AuthorDate: Mon Aug 1 17:44:00 2022 +0600

    Introduce imlib_load_image_frame_mem
---
 src/lib/Imlib2.h.in | 19 +++++++++++++++++++
 src/lib/api.c       | 18 ++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/src/lib/Imlib2.h.in b/src/lib/Imlib2.h.in
index 3e9128a..28671ad 100644
--- a/src/lib/Imlib2.h.in
+++ b/src/lib/Imlib2.h.in
@@ -2869,6 +2869,25 @@ typedef struct {
  */
 EAPI Imlib_Image    imlib_load_image_frame(const char *file, int frame);
 
+/**
+ * Load image frame form memory
+ *
+ * Loads the specified frame within the image from memory.
+ * The file name @p file is only used to guess the file format.
+ * On success an image handle is returned, otherwise NULL is returned
+ * (e.g. if the requested frame does not exist).
+ * The image is loaded immediately.
+ *
+ * @param file          File name
+ * @param frame         Frame number
+ * @param data          Image data
+ * @param size          Image data size
+ *
+ * @return Image handle (NULL on failure)
+ */
+EAPI Imlib_Image    imlib_load_image_frame_mem(const char *file, int frame,
+                                               const void *data, size_t size);
+
 /**
  * Get information about current image frame
  *
diff --git a/src/lib/api.c b/src/lib/api.c
index de19010..ac375bf 100644
--- a/src/lib/api.c
+++ b/src/lib/api.c
@@ -919,6 +919,24 @@ imlib_load_image_frame(const char *file, int frame)
    return im;
 }
 
+EAPI                Imlib_Image
+imlib_load_image_frame_mem(const char *file, int frame, const void *data,
+                           size_t size)
+{
+   Imlib_Image         im;
+   ImlibLoadArgs       ila = { ILA0(ctx, 1, 0),.frame = frame };
+
+   CHECK_PARAM_POINTER_RETURN("file", file, NULL);
+   CHECK_PARAM_POINTER_RETURN("data", data, NULL);
+
+   ila.fdata = data;
+   ila.fsize = size;
+
+   im = __imlib_LoadImage(file, &ila);
+
+   return im;
+}
+
 EAPI void
 imlib_image_get_frame_info(Imlib_Frame_Info * info)
 {

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

Reply via email to