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 3f1f87b1fb3997f9ee1a3802af4edb9b5257f2e4
Author: Kim Woelders <[email protected]>
AuthorDate: Fri Jul 8 20:03:56 2022 +0200

    loading: Don't look for cached image when not caching
---
 src/lib/image.c | 51 +++++++++++++++++++++++++++------------------------
 1 file changed, 27 insertions(+), 24 deletions(-)

diff --git a/src/lib/image.c b/src/lib/image.c
index cc3acec..fa50679 100644
--- a/src/lib/image.c
+++ b/src/lib/image.c
@@ -379,40 +379,43 @@ __imlib_LoadImage(const char *file, ImlibLoadArgs * ila)
    if (!file || file[0] == '\0')
       return NULL;
 
-   /* see if we already have the image cached */
-   im = __imlib_FindCachedImage(file, ila->frame);
-
-   /* if we found a cached image and we should always check that it is */
-   /* accurate to the disk conents if they changed since we last loaded */
-   /* and that it is still a valid image */
-   if (im && !IM_FLAG_ISSET(im, F_INVALID))
+   if (!ila->nocache)
      {
-        if (IM_FLAG_ISSET(im, F_ALWAYS_CHECK_DISK))
-          {
-             time_t              current_modified_time;
+        /* see if we already have the image cached */
+        im = __imlib_FindCachedImage(file, ila->frame);
 
-             current_modified_time = ila->fp ?
-                __imlib_FileModDateFd(fileno(ila->fp)) :
-                __imlib_FileModDate(im->real_file);
-             /* if the file on disk is newer than the cached one */
-             if (current_modified_time != im->moddate)
+        /* if we found a cached image and we should always check that it is */
+        /* accurate to the disk conents if they changed since we last loaded */
+        /* and that it is still a valid image */
+        if (im && !IM_FLAG_ISSET(im, F_INVALID))
+          {
+             if (IM_FLAG_ISSET(im, F_ALWAYS_CHECK_DISK))
                {
-                  /* invalidate image */
-                  IM_FLAG_SET(im, F_INVALID);
+                  time_t              current_modified_time;
+
+                  current_modified_time = ila->fp ?
+                     __imlib_FileModDateFd(fileno(ila->fp)) :
+                     __imlib_FileModDate(im->real_file);
+                  /* if the file on disk is newer than the cached one */
+                  if (current_modified_time != im->moddate)
+                    {
+                       /* invalidate image */
+                       IM_FLAG_SET(im, F_INVALID);
+                    }
+                  else
+                    {
+                       /* image is ok to re-use - program is just being stupid loading */
+                       /* the same data twice */
+                       im->references++;
+                       return im;
+                    }
                }
              else
                {
-                  /* image is ok to re-use - program is just being stupid loading */
-                  /* the same data twice */
                   im->references++;
                   return im;
                }
           }
-        else
-          {
-             im->references++;
-             return im;
-          }
      }
 
    im_file = im_key = NULL;

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

Reply via email to