nsxivac4eb53
Fixed issue #28 (again)
+15 −11
3 files changed
| @@ -1,4 +1,4 @@ | |||
| 1 | − | VERSION = git-20111111 | |
| 1 | + | VERSION = git-20111113 | |
| 2 | 2 | ||
| 3 | 3 | CC = gcc | |
| 4 | 4 | CFLAGS = -ansi -Wall -pedantic -O2 | |
| @@ -311,16 +311,18 @@ bool img_load(img_t *img, const fileinfo_t *file) { | |||
| 311 | 311 | imlib_image_set_changes_on_disk(); | |
| 312 | 312 | imlib_context_set_anti_alias(img->aa); | |
| 313 | 313 | ||
| 314 | − | if ((fmt = imlib_image_format()) != NULL) { | |
| 314 | + | if ((fmt = imlib_image_format()) == NULL) { | |
| 315 | + | warn("could not open image: %s", file->name); | |
| 316 | + | return false; | |
| 317 | + | } | |
| 315 | 318 | #if EXIF_SUPPORT | |
| 316 | − | if (STREQ(fmt, "jpeg")) | |
| 317 | − | exif_auto_orientate(file); | |
| 319 | + | if (STREQ(fmt, "jpeg")) | |
| 320 | + | exif_auto_orientate(file); | |
| 318 | 321 | #endif | |
| 319 | 322 | #if GIF_SUPPORT | |
| 320 | − | if (STREQ(fmt, "gif")) | |
| 321 | − | img_load_gif(img, file); | |
| 323 | + | if (STREQ(fmt, "gif")) | |
| 324 | + | img_load_gif(img, file); | |
| 322 | 325 | #endif | |
| 323 | − | } | |
| 324 | 326 | ||
| 325 | 327 | img->w = imlib_image_get_width(); | |
| 326 | 328 | img->h = imlib_image_get_height(); | |
| @@ -253,10 +253,12 @@ bool tns_load(tns_t *tns, int n, const fileinfo_t *file, | |||
| 253 | 253 | imlib_context_set_image(im); | |
| 254 | 254 | imlib_context_set_anti_alias(1); | |
| 255 | 255 | ||
| 256 | − | fmt = imlib_image_format(); | |
| 257 | − | /* avoid unused-but-set-variable warning */ | |
| 258 | − | (void) fmt; | |
| 259 | − | ||
| 256 | + | if ((fmt = imlib_image_format()) == NULL) { | |
| 257 | + | if (!silent) | |
| 258 | + | warn("could not open image: %s", file->name); | |
| 259 | + | imlib_free_image_and_decache(); | |
| 260 | + | return false; | |
| 261 | + | } | |
| 260 | 262 | #if EXIF_SUPPORT | |
| 261 | 263 | if (!cache_hit && STREQ(fmt, "jpeg")) | |
| 262 | 264 | exif_auto_orientate(file); | |