diff options
Diffstat (limited to 'image.c')
-rw-r--r-- | image.c | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -412,16 +412,10 @@ Imlib_Image img_open(const fileinfo_t *file) Imlib_Image im = NULL; if (access(file->path, R_OK) == 0 && - stat(file->path, &st) == 0 && S_ISREG(st.st_mode)) + stat(file->path, &st) == 0 && S_ISREG(st.st_mode) && + (im = imlib_load_image_immediately(file->path)) != NULL) { - im = imlib_load_image(file->path); - if (im != NULL) { - imlib_context_set_image(im); - if (imlib_image_get_data_for_reading_only() == NULL) { - imlib_free_image(); - im = NULL; - } - } + imlib_context_set_image(im); } if (im == NULL && (file->flags & FF_WARN)) error(0, 0, "%s: Error opening image", file->name); |