Fixed issue #74, conditional compilation of gif support

This commit is contained in:
Bert Münnich 2012-12-27 16:43:19 +01:00
parent cd929eabfe
commit 97a2c05cc3
2 changed files with 9 additions and 3 deletions

View file

@ -1,10 +1,10 @@
VERSION = git-20121220 VERSION = git-20121227
PREFIX = /usr/local PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man MANPREFIX = $(PREFIX)/share/man
CC = gcc CC = gcc
CFLAGS = -Wall -pedantic -O2 -I$(PREFIX) CFLAGS = -Wall -pedantic -O2 -I$(PREFIX) -DHAVE_GIFLIB
LDFLAGS = -L$(PREFIX) LDFLAGS = -L$(PREFIX)
LIBS = -lX11 -lImlib2 -lgif LIBS = -lX11 -lImlib2 -lgif

View file

@ -23,7 +23,6 @@
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include <gif_lib.h>
#include "exif.h" #include "exif.h"
#include "image.h" #include "image.h"
@ -31,7 +30,10 @@
#include "util.h" #include "util.h"
#include "config.h" #include "config.h"
#if HAVE_GIFLIB
#include <gif_lib.h>
enum { MIN_GIF_DELAY = 25 }; enum { MIN_GIF_DELAY = 25 };
#endif
float zoom_min; float zoom_min;
float zoom_max; float zoom_max;
@ -92,6 +94,7 @@ void exif_auto_orientate(const fileinfo_t *file) {
} }
} }
#if HAVE_GIFLIB
bool img_load_gif(img_t *img, const fileinfo_t *file) { bool img_load_gif(img_t *img, const fileinfo_t *file) {
GifFileType *gif; GifFileType *gif;
GifRowType *rows = NULL; GifRowType *rows = NULL;
@ -261,6 +264,7 @@ bool img_load_gif(img_t *img, const fileinfo_t *file) {
return !err; return !err;
} }
#endif /* HAVE_GIFLIB */
bool img_load(img_t *img, const fileinfo_t *file) { bool img_load(img_t *img, const fileinfo_t *file) {
const char *fmt; const char *fmt;
@ -284,8 +288,10 @@ bool img_load(img_t *img, const fileinfo_t *file) {
} }
if (STREQ(fmt, "jpeg")) if (STREQ(fmt, "jpeg"))
exif_auto_orientate(file); exif_auto_orientate(file);
#if HAVE_GIFLIB
if (STREQ(fmt, "gif")) if (STREQ(fmt, "gif"))
img_load_gif(img, file); img_load_gif(img, file);
#endif
img->w = imlib_image_get_width(); img->w = imlib_image_get_width();
img->h = imlib_image_get_height(); img->h = imlib_image_get_height();