From 23ed5115c01371e2f6d2556ad9b909be906e5bd2 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 3 Jun 2013 09:16:25 +0100 Subject: [PATCH] evas: Fix evas gif image loader for libgif version 5 Because arc doesn't like me much at the moment here's a simple patch to fix the gif loader for the latest libgif version. DGifOpen now takes a error param as its final argument, if the param is not NULL it will return a error code if it fails. Similar to another patch i sent a few months back. The patch has been tested on OBS for old and new versions. --- src/modules/evas/loaders/gif/evas_image_load_gif.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/modules/evas/loaders/gif/evas_image_load_gif.c b/src/modules/evas/loaders/gif/evas_image_load_gif.c index f3cfd9f..40c2aa8 100644 --- a/src/modules/evas/loaders/gif/evas_image_load_gif.c +++ b/src/modules/evas/loaders/gif/evas_image_load_gif.c @@ -728,7 +728,11 @@ evas_image_load_file_head_gif(void *loader_data, egi.length = eina_file_size_get(f); egi.position = 0; +#if GIFLIB_MAJOR >= 5 + gif = DGifOpen(&egi, _evas_image_load_file_read, NULL); +#else gif = DGifOpen(&egi, _evas_image_load_file_read); +#endif if (!gif) { *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; @@ -870,7 +874,11 @@ evas_image_load_specific_frame(Eina_File *f, egi.length = eina_file_size_get(f); egi.position = 0; +#if GIFLIB_MAJOR >= 5 + gif = DGifOpen(&egi, _evas_image_load_file_read, NULL); +#else gif = DGifOpen(&egi, _evas_image_load_file_read); +#endif if (!gif) { *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; @@ -970,7 +978,11 @@ evas_image_load_file_data_gif(void *loader_data, egi.length = eina_file_size_get(f); egi.position = 0; +#if GIFLIB_MAJOR >= 5 + gif = DGifOpen(&egi, _evas_image_load_file_read, NULL); +#else gif = DGifOpen(&egi, _evas_image_load_file_read); +#endif if (!gif) { *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; @@ -1043,8 +1055,11 @@ evas_image_load_frame_duration_gif(void *loader_data, if (!egi.map) goto on_error; egi.length = eina_file_size_get(f); egi.position = 0; - +#if GIFLIB_MAJOR >= 5 + gif = DGifOpen(&egi, _evas_image_load_file_read, NULL); +#else gif = DGifOpen(&egi, _evas_image_load_file_read); +#endif if (!gif) goto on_error; duration = 0; -- 2.7.4