Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- mapserver-6.2.1.orig/mapimageio.c 2013-04-19 21:08:49.000000000 -0700
- +++ mapserver-6.2.1/mapimageio.c 2015-01-30 16:47:46.000000000 -0800
- @@ -994,11 +994,18 @@
- }
- }
- #ifdef USE_GIF
- +#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
- +#define gif_error_msg() _gif_error_msg(image->Error)
- +static char const *_gif_error_msg(int code)
- +#else
- static char const *gif_error_msg()
- +#endif
- {
- static char msg[80];
- +#if !(defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5)
- int code = GifLastError();
- +#endif
- switch (code) {
- case E_GIF_ERR_OPEN_FAILED: /* should not see this */
- return "Failed to open given file";
- @@ -1075,7 +1082,6 @@
- }
- }
- -
- /* not fully implemented and tested */
- /* missing: set the first pointer to a,r,g,b */
- int readGIF(char *path, rasterBufferObj *rb)
- @@ -1092,12 +1098,21 @@
- int interlacedJumps[] = {8,8,4,2};
- - rb->type = MS_BUFFER_BYTE_RGBA;
- +#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
- + int err = 0;
- + image = DGifOpenFileName(path, &err);
- + if (image == NULL) {
- + msSetError(MS_MISCERR,"failed to load gif image: %s","readGIF()", _gif_error_msg(err));
- + return MS_FAILURE;
- + }
- +#else
- image = DGifOpenFileName(path);
- if (image == NULL) {
- msSetError(MS_MISCERR,"failed to load gif image: %s","readGIF()", gif_error_msg());
- return MS_FAILURE;
- }
- +#endif
- + rb->type = MS_BUFFER_BYTE_RGBA;
- rb->width = image->SWidth;
- rb->height = image->SHeight;
- rb->data.rgba.row_step = rb->width * 4;
- @@ -1253,11 +1268,17 @@
- } while (recordType != TERMINATE_RECORD_TYPE);
- +#if defined(GIFLIB_MAJOR) && GIFLIB_MAJOR >= 5
- + if (DGifCloseFile(image, &err) == GIF_ERROR) {
- + msSetError(MS_MISCERR,"failed to close gif after loading: %s","readGIF()", _gif_error_msg(err));
- + return MS_FAILURE;
- + }
- +#else
- if (DGifCloseFile(image) == GIF_ERROR) {
- msSetError(MS_MISCERR,"failed to close gif after loading: %s","readGIF()", gif_error_msg());
- return MS_FAILURE;
- }
- -
- +#endif
- return MS_SUCCESS;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement