From 97a2c05cc30adb3b90842b671607a05857db63a0 Mon Sep 17 00:00:00 2001 From: Bert Münnich Date: Thu, 27 Dec 2012 16:43:19 +0100 Subject: Fixed issue #74, conditional compilation of gif support --- Makefile | 4 ++-- image.c | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 193d415..a157421 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ -VERSION = git-20121220 +VERSION = git-20121227 PREFIX = /usr/local MANPREFIX = $(PREFIX)/share/man CC = gcc -CFLAGS = -Wall -pedantic -O2 -I$(PREFIX) +CFLAGS = -Wall -pedantic -O2 -I$(PREFIX) -DHAVE_GIFLIB LDFLAGS = -L$(PREFIX) LIBS = -lX11 -lImlib2 -lgif diff --git a/image.c b/image.c index d147c1b..6ca2cd3 100644 --- a/image.c +++ b/image.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "exif.h" #include "image.h" @@ -31,7 +30,10 @@ #include "util.h" #include "config.h" +#if HAVE_GIFLIB +#include enum { MIN_GIF_DELAY = 25 }; +#endif float zoom_min; 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) { GifFileType *gif; GifRowType *rows = NULL; @@ -261,6 +264,7 @@ bool img_load_gif(img_t *img, const fileinfo_t *file) { return !err; } +#endif /* HAVE_GIFLIB */ bool img_load(img_t *img, const fileinfo_t *file) { const char *fmt; @@ -284,8 +288,10 @@ bool img_load(img_t *img, const fileinfo_t *file) { } if (STREQ(fmt, "jpeg")) exif_auto_orientate(file); +#if HAVE_GIFLIB if (STREQ(fmt, "gif")) img_load_gif(img, file); +#endif img->w = imlib_image_get_width(); img->h = imlib_image_get_height(); -- cgit v1.2.3-54-g00ecf