diff options
author | antoine <antoine@FreeBSD.org> | 2015-11-13 02:35:53 +0800 |
---|---|---|
committer | antoine <antoine@FreeBSD.org> | 2015-11-13 02:35:53 +0800 |
commit | d0f1ec94be6a99911f6cca042256e5988f348e2b (patch) | |
tree | 07ffa1194a060dd6c8f50a2046c9b422bc054830 /graphics | |
parent | e68f201aed7fe126d43c2e327bee9b8d651694ec (diff) | |
download | freebsd-ports-gnome-d0f1ec94be6a99911f6cca042256e5988f348e2b.tar.gz freebsd-ports-gnome-d0f1ec94be6a99911f6cca042256e5988f348e2b.tar.zst freebsd-ports-gnome-d0f1ec94be6a99911f6cca042256e5988f348e2b.zip |
Allow building with giflib 5.1
PR: 204492
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/exact-image/files/patch-codecs__gif.cc | 28 | ||||
-rw-r--r-- | graphics/mapserver/files/patch-mapimageio.c | 14 | ||||
-rw-r--r-- | graphics/ocaml-images/files/patch-src_gifread.c | 14 | ||||
-rw-r--r-- | graphics/ocaml-images/files/patch-src_gifwrite.c | 14 | ||||
-rw-r--r-- | graphics/osg/files/patch-src_osgPlugins_gif_ReaderWriterGIF.cpp | 14 | ||||
-rw-r--r-- | graphics/php5-swfed/files/patch-swf__gif.c | 51 | ||||
-rw-r--r-- | graphics/simpleviewer/files/patch-src_formats_formatgif.cpp | 24 |
7 files changed, 149 insertions, 10 deletions
diff --git a/graphics/exact-image/files/patch-codecs__gif.cc b/graphics/exact-image/files/patch-codecs__gif.cc index 361e891e3c69..e12cc6ca44f3 100644 --- a/graphics/exact-image/files/patch-codecs__gif.cc +++ b/graphics/exact-image/files/patch-codecs__gif.cc @@ -115,7 +115,19 @@ return false; } } -@@ -166,7 +212,11 @@ bool GIFCodec::writeImage (std::ostream* +@@ -155,7 +201,11 @@ int GIFCodec::readImage (std::istream* s + // convert colormap to our 16bit "TIFF"format + colorspace_de_palette (image, ColorMap->ColorCount, rmap, gmap, bmap); + ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ EGifCloseFile(GifFile, NULL); ++#else + EGifCloseFile(GifFile); ++#endif + + return true; + } +@@ -166,7 +216,11 @@ bool GIFCodec::writeImage (std::ostream* GifFileType* GifFile; GifByteType* Ptr; @@ -127,7 +139,7 @@ { std::cerr << "Error preparing GIF file for writing." << std::endl; return false; -@@ -175,7 +225,11 @@ bool GIFCodec::writeImage (std::ostream* +@@ -175,7 +229,11 @@ bool GIFCodec::writeImage (std::ostream* int ColorMapSize = 256; // later use our own colormap generation @@ -139,7 +151,7 @@ if (!OutputColorMap) return false; -@@ -203,7 +257,11 @@ bool GIFCodec::writeImage (std::ostream* +@@ -203,7 +261,11 @@ bool GIFCodec::writeImage (std::ostream* } @@ -151,7 +163,7 @@ RedBuffer, GreenBuffer, BlueBuffer, OutputBuffer, OutputColorMap->Colors) == GIF_ERROR) { return false; -@@ -215,7 +273,7 @@ bool GIFCodec::writeImage (std::ostream* +@@ -215,7 +277,7 @@ bool GIFCodec::writeImage (std::ostream* if (EGifPutScreenDesc(GifFile, image.w, image.h, ColorMapSize, 0, OutputColorMap) == GIF_ERROR || EGifPutImageDesc(GifFile, 0, 0, image.w, image.h, @@ -160,12 +172,18 @@ { std::cerr << "Error writing GIF header." << std::endl; return false; -@@ -232,7 +290,7 @@ bool GIFCodec::writeImage (std::ostream* +@@ -232,9 +294,13 @@ bool GIFCodec::writeImage (std::ostream* } free (OutputBuffer); - delete (RedBuffer); delete (GreenBuffer); delete (BlueBuffer); + delete[] RedBuffer; delete[] GreenBuffer; delete[] BlueBuffer; ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ EGifCloseFile(GifFile, NULL); ++#else EGifCloseFile(GifFile); ++#endif return true; + } + diff --git a/graphics/mapserver/files/patch-mapimageio.c b/graphics/mapserver/files/patch-mapimageio.c new file mode 100644 index 000000000000..f103715e0b36 --- /dev/null +++ b/graphics/mapserver/files/patch-mapimageio.c @@ -0,0 +1,14 @@ +--- mapimageio.c.orig 2015-07-24 07:59:36 UTC ++++ mapimageio.c +@@ -1058,7 +1058,11 @@ int readGIF(char *path, rasterBufferObj + + } while (recordType != TERMINATE_RECORD_TYPE); + ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ if (DGifCloseFile(image, NULL) == GIF_ERROR) { ++#else + if (DGifCloseFile(image) == GIF_ERROR) { ++#endif + #if defined GIFLIB_MAJOR && GIFLIB_MAJOR >= 5 + msSetError(MS_MISCERR,"failed to close gif after loading: %s","readGIF()", gif_error_msg(image->Error)); + #else diff --git a/graphics/ocaml-images/files/patch-src_gifread.c b/graphics/ocaml-images/files/patch-src_gifread.c index cc4bb948f83f..c2b49558342c 100644 --- a/graphics/ocaml-images/files/patch-src_gifread.c +++ b/graphics/ocaml-images/files/patch-src_gifread.c @@ -12,7 +12,19 @@ failwith("DGifOpenFileName"); } -@@ -200,7 +204,6 @@ value dGifGetLine( value hdl ) +@@ -161,7 +165,11 @@ value dGifCloseFile( value hdl ) + segmentation faults */ + ((GifFileType *)hdl)->Image.ColorMap = NULL; + ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile( (GifFileType *) hdl, NULL ); ++#else + DGifCloseFile( (GifFileType *) hdl ); ++#endif + CAMLreturn(Val_unit); + } + +@@ -200,7 +208,6 @@ value dGifGetLine( value hdl ) if( DGifGetLine(GifFile, String_val(buf), GifFile->Image.Width ) == GIF_ERROR ){ diff --git a/graphics/ocaml-images/files/patch-src_gifwrite.c b/graphics/ocaml-images/files/patch-src_gifwrite.c index 715f8e018910..0fbcede2549c 100644 --- a/graphics/ocaml-images/files/patch-src_gifwrite.c +++ b/graphics/ocaml-images/files/patch-src_gifwrite.c @@ -33,7 +33,19 @@ failwith("EGifOpenFileName"); } /* gcc -fwritable-strings is required to compile libungif */ -@@ -133,7 +141,6 @@ value eGifPutLine( value oc, value buf ) +@@ -88,7 +96,11 @@ value eGifCloseFile( value hdl ) + segmentation faults */ + ((GifFileType *)hdl)->Image.ColorMap = NULL; + ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ EGifCloseFile( (GifFileType *) hdl, NULL ); ++#else + EGifCloseFile( (GifFileType *) hdl ); ++#endif + CAMLreturn(Val_unit); + } + +@@ -133,7 +145,6 @@ value eGifPutLine( value oc, value buf ) if ( EGifPutLine(GifFileOut, String_val(buf), GifFileOut->Image.Width) == GIF_ERROR ){ diff --git a/graphics/osg/files/patch-src_osgPlugins_gif_ReaderWriterGIF.cpp b/graphics/osg/files/patch-src_osgPlugins_gif_ReaderWriterGIF.cpp new file mode 100644 index 000000000000..f825216c55c5 --- /dev/null +++ b/graphics/osg/files/patch-src_osgPlugins_gif_ReaderWriterGIF.cpp @@ -0,0 +1,14 @@ +--- src/osgPlugins/gif/ReaderWriterGIF.cpp.orig 2013-06-03 14:04:02 UTC ++++ src/osgPlugins/gif/ReaderWriterGIF.cpp +@@ -561,7 +561,11 @@ GifImageStream** obj) + *width_ret = giffile->SWidth; + *height_ret = giffile->SHeight; + *numComponents_ret = 4; ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(giffile, NULL); ++#else + DGifCloseFile(giffile); ++#endif + return buffer; + } + diff --git a/graphics/php5-swfed/files/patch-swf__gif.c b/graphics/php5-swfed/files/patch-swf__gif.c index 01812c8cbe15..b91cb70f5b90 100644 --- a/graphics/php5-swfed/files/patch-swf__gif.c +++ b/graphics/php5-swfed/files/patch-swf__gif.c @@ -1,6 +1,6 @@ --- swf_gif.c.orig 2014-02-10 02:32:16 UTC +++ swf_gif.c -@@ -132,7 +132,11 @@ gifconv_gif2lossless(unsigned char *gif_ +@@ -132,14 +132,22 @@ gifconv_gif2lossless(unsigned char *gif_ gif_buff.data = gif_data; gif_buff.data_len = gif_data_len; gif_buff.data_offset = 0; @@ -12,7 +12,42 @@ if (GifFile == NULL) { fprintf(stderr, "gifconv_gif2lossless: can't open GIFFile\n"); return NULL; -@@ -252,7 +256,11 @@ gifconv_lossless2gif(void *image_data, + } + if (DGifSlurp(GifFile) == GIF_ERROR) { + fprintf(stderr, "gifconv_gif2lossless: DGifSlurp failed\n"); ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(GifFile, NULL); ++#else + DGifCloseFile(GifFile); ++#endif + return NULL; + } + Image = GifFile->SavedImages[0]; +@@ -152,7 +160,11 @@ gifconv_gif2lossless(unsigned char *gif_ + bpp = ColorMap->BitsPerPixel; + if (bpp > 8) { + fprintf(stderr, "gifconv_gif2lossless: bpp=%d not implemented. accept only bpp <= 8\n", bpp); ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(GifFile, NULL); ++#else + DGifCloseFile(GifFile); ++#endif + return NULL; + } + palette_num = ColorMap->ColorCount; +@@ -216,7 +228,11 @@ gifconv_gif2lossless(unsigned char *gif_ + * destruct + */ + if (GifFile) { ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(GifFile, NULL); ++#else + DGifCloseFile(GifFile); ++#endif + } + return image_data; + } +@@ -252,7 +268,11 @@ gifconv_lossless2gif(void *image_data, gif_buff.data = NULL; gif_buff.data_len = 0; gif_buff.data_offset = 0; @@ -24,7 +59,7 @@ if (GifFile == NULL) { fprintf(stderr, "gifconv_lossless2gif: can't open GIFFile\n"); return NULL; -@@ -292,7 +300,11 @@ gifconv_lossless2gif(void *image_data, +@@ -292,13 +312,21 @@ gifconv_lossless2gif(void *image_data, } GifFile->SavedImages[0].RasterBits = gif_image_data; @@ -36,3 +71,13 @@ EGifSpew(GifFile); // XXX free(gif_image_data); + + if (GifFile) { ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ EGifCloseFile(GifFile, NULL); ++#else + EGifCloseFile(GifFile); ++#endif + } + *length = gif_buff.data_offset; + return gif_buff.data; diff --git a/graphics/simpleviewer/files/patch-src_formats_formatgif.cpp b/graphics/simpleviewer/files/patch-src_formats_formatgif.cpp index 046ba05d256e..a387caa05dbb 100644 --- a/graphics/simpleviewer/files/patch-src_formats_formatgif.cpp +++ b/graphics/simpleviewer/files/patch-src_formats_formatgif.cpp @@ -12,3 +12,27 @@ if(file == 0) { std::cout << "Error Opening GIF image" << std::endl; return false; +@@ -31,7 +35,11 @@ bool CFormatGif::Load(const char* filena + int res = DGifSlurp(file); + if(res != GIF_OK || file->ImageCount < 1) { + std::cout << "Error Opening GIF image" << std::endl; ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(file, NULL); ++#else + DGifCloseFile(file); ++#endif + return false; + } + +@@ -130,7 +138,11 @@ bool CFormatGif::Load(const char* filena + // + // std::cout << "Record Type" << (int)recordType << std::endl; + ++#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 ++ DGifCloseFile(file, NULL); ++#else + DGifCloseFile(file); ++#endif + + return true; + } |