diff options
author | Philip Van Hoof <philip@codeminded.be> | 2014-02-10 20:36:16 +0100 |
---|---|---|
committer | Philip Van Hoof <philip@codeminded.be> | 2014-03-12 10:31:45 +0100 |
commit | bf3cc058d363ee07164f191663a341a55725201c (patch) | |
tree | 223064a4a1263e47d18446424208429af92a35eb | |
parent | f0fc3f844ba15fff789a3b4b9fa604a78626d8a8 (diff) | |
download | tracker-bf3cc058d363ee07164f191663a341a55725201c.tar.gz |
giflib 4.2.x doesn't have PrintGifError
-rw-r--r-- | src/tracker-extract/tracker-extract-gif.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/tracker-extract/tracker-extract-gif.c b/src/tracker-extract/tracker-extract-gif.c index e482a26cc..80d0453bf 100644 --- a/src/tracker-extract/tracker-extract-gif.c +++ b/src/tracker-extract/tracker-extract-gif.c @@ -84,6 +84,20 @@ gif_error (const gchar *action, int err) g_message ("%s, undefined error %d", action, err); } } +#else /* GIFLIB_MAJOR >= 5 */ +static inline void print_gif_error() +{ +#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && ((GIFLIB_MAJOR == 4 && GIFLIB_MINOR >= 2) || GIFLIB_MAJOR > 4) + const char *str = GifErrorString (); + if (str != NULL) { + g_message ("GIF, error: '%s'", str); + } else { + g_message ("GIF, undefined error"); + } +#else + PrintGifError(); +#endif +} #endif /* GIFLIB_MAJOR >= 5 */ static void @@ -112,7 +126,7 @@ read_metadata (TrackerSparqlBuilder *preupdate, if (DGifGetRecordType(gifFile, &RecordType) == GIF_ERROR) { #if GIFLIB_MAJOR < 5 - PrintGifError (); + print_gif_error (); #else /* GIFLIB_MAJOR < 5 */ gif_error ("Could not read next GIF record type", gifFile->Error); #endif /* GIFLIB_MAJOR < 5 */ @@ -123,7 +137,7 @@ read_metadata (TrackerSparqlBuilder *preupdate, case IMAGE_DESC_RECORD_TYPE: if (DGifGetImageDesc(gifFile) == GIF_ERROR) { #if GIFLIB_MAJOR < 5 - PrintGifError(); + print_gif_error(); #else /* GIFLIB_MAJOR < 5 */ gif_error ("Could not get GIF record information", gifFile->Error); #endif /* GIFLIB_MAJOR < 5 */ @@ -137,7 +151,7 @@ read_metadata (TrackerSparqlBuilder *preupdate, if (DGifGetLine(gifFile, framedata, framewidth*frameheight)==GIF_ERROR) { #if GIFLIB_MAJOR < 5 - PrintGifError(); + print_gif_error(); #else /* GIFLIB_MAJOR < 5 */ gif_error ("Could not load a block of GIF pixes", gifFile->Error); #endif /* GIFLIB_MAJOR < 5 */ @@ -645,7 +659,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info) #if GIFLIB_MAJOR < 5 if ((gifFile = DGifOpenFileHandle (fd)) == NULL) { - PrintGifError (); + print_gif_error (); #else /* GIFLIB_MAJOR < 5 */ if ((gifFile = DGifOpenFileHandle (fd, &err)) == NULL) { gif_error ("Could not open GIF file with handle", err); @@ -672,7 +686,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info) if (DGifCloseFile (gifFile) != GIF_OK) { #if GIFLIB_MAJOR < 5 - PrintGifError (); + print_gif_error (); #else /* GIFLIB_MAJOR < 5 */ gif_error ("Could not close GIF file", gifFile->Error); #endif /* GIFLIB_MAJOR < 5 */ |