Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
Fixed issue #28 (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bert Münnich committed Nov 13, 2011
1 parent c4007be commit ac4eb53
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = git-20111111
VERSION = git-20111113

CC = gcc
CFLAGS = -ansi -Wall -pedantic -O2
Expand Down
14 changes: 8 additions & 6 deletions image.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,16 +311,18 @@ bool img_load(img_t *img, const fileinfo_t *file) {
imlib_image_set_changes_on_disk();
imlib_context_set_anti_alias(img->aa);

if ((fmt = imlib_image_format()) != NULL) {
if ((fmt = imlib_image_format()) == NULL) {
warn("could not open image: %s", file->name);
return false;
}
#if EXIF_SUPPORT
if (STREQ(fmt, "jpeg"))
exif_auto_orientate(file);
if (STREQ(fmt, "jpeg"))
exif_auto_orientate(file);
#endif
#if GIF_SUPPORT
if (STREQ(fmt, "gif"))
img_load_gif(img, file);
if (STREQ(fmt, "gif"))
img_load_gif(img, file);
#endif
}

img->w = imlib_image_get_width();
img->h = imlib_image_get_height();
Expand Down
10 changes: 6 additions & 4 deletions thumbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,12 @@ bool tns_load(tns_t *tns, int n, const fileinfo_t *file,
imlib_context_set_image(im);
imlib_context_set_anti_alias(1);

fmt = imlib_image_format();
/* avoid unused-but-set-variable warning */
(void) fmt;

if ((fmt = imlib_image_format()) == NULL) {
if (!silent)
warn("could not open image: %s", file->name);
imlib_free_image_and_decache();
return false;
}
#if EXIF_SUPPORT
if (!cache_hit && STREQ(fmt, "jpeg"))
exif_auto_orientate(file);
Expand Down

0 comments on commit ac4eb53

Please sign in to comment.