aboutsummaryrefslogtreecommitdiff
path: root/graphics/exact-image
diff options
context:
space:
mode:
authorAntoine Brodin <antoine@FreeBSD.org>2015-11-12 18:35:53 +0000
committerAntoine Brodin <antoine@FreeBSD.org>2015-11-12 18:35:53 +0000
commitc905c203db0c9756a47ecca2243013bfa462026d (patch)
tree07ffa1194a060dd6c8f50a2046c9b422bc054830 /graphics/exact-image
parentf44de4a8d49fd8ce374780f235c163a9d3d9cd1a (diff)
Allow building with giflib 5.1
PR: 204492
Notes
Notes: svn path=/head/; revision=401387
Diffstat (limited to 'graphics/exact-image')
-rw-r--r--graphics/exact-image/files/patch-codecs__gif.cc28
1 files changed, 23 insertions, 5 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;
+ }
+