| @@ -239,6 +239,7 @@ bool tns_load(tns_t *tns, int n, bool force, bool cache_only) |
| 239 | 239 | | float zw, zh; |
| 240 | 240 | | thumb_t *t; |
| 241 | 241 | | fileinfo_t *file; |
| 242 | + | struct stat st; |
| 242 | 243 | | Imlib_Image im = NULL; |
| 243 | 244 | | |
| 244 | 245 | | if (n < 0 || n >= *tns->cnt) |
| @@ -330,12 +331,15 @@ bool tns_load(tns_t *tns, int n, bool force, bool cache_only) |
| 330 | 331 | | } |
| 331 | 332 | | } |
| 332 | 333 | | |
| 333 | | − | if (im == NULL && (access(file->path, R_OK) < 0 || |
| 334 | | − | (im = imlib_load_image(file->path)) == NULL)) |
| 335 | | − | { |
| 336 | | − | if (file->flags & FF_WARN) |
| 337 | | − | error(0, 0, "%s: Error opening image", file->name); |
| 338 | | − | return false; |
| 334 | + | if (im == NULL) { |
| 335 | + | if (access(file->path, R_OK) == -1 || |
| 336 | + | stat(file->path, &st) == -1 || !S_ISREG(st.st_mode) || |
| 337 | + | (im = imlib_load_image(file->path)) == NULL) |
| 338 | + | { |
| 339 | + | if (file->flags & FF_WARN) |
| 340 | + | error(0, 0, "%s: Error opening image", file->name); |
| 341 | + | return false; |
| 342 | + | } |
| 339 | 343 | | } |
| 340 | 344 | | imlib_context_set_image(im); |
| 341 | 345 | | |