[93426] trunk/dports/gis/gdal

stromnov at macports.org stromnov at macports.org
Tue May 22 06:48:39 PDT 2012


Revision: 93426
          https://trac.macports.org/changeset/93426
Author:   stromnov at macports.org
Date:     2012-05-22 06:48:39 -0700 (Tue, 22 May 2012)
Log Message:
-----------
gdal: fix for PrintGif error (maintainer request)

Modified Paths:
--------------
    trunk/dports/gis/gdal/Portfile

Added Paths:
-----------
    trunk/dports/gis/gdal/files/patch-frmts_gif_gifdataset.cpp.diff

Modified: trunk/dports/gis/gdal/Portfile
===================================================================
--- trunk/dports/gis/gdal/Portfile	2012-05-22 13:27:50 UTC (rev 93425)
+++ trunk/dports/gis/gdal/Portfile	2012-05-22 13:48:39 UTC (rev 93426)
@@ -3,7 +3,7 @@
 PortSystem	1.0
 name		gdal
 version		1.9.0
-revision    2
+revision    3
 maintainers	gmail.com:seanasy
 platforms	darwin
 license		MIT BSD
@@ -58,7 +58,8 @@
 				--mandir=${prefix}/share/man
 # Patch to ensure that the python installation respects DESTDIR
 patchfiles	patch-swig_python_GNUmakefile \
-			patch-gdalwarpkernel_opencl_c.diff
+			patch-gdalwarpkernel_opencl_c.diff \
+			patch-frmts_gif_gifdataset.cpp.diff
 
 # Patches for universal build
 

Added: trunk/dports/gis/gdal/files/patch-frmts_gif_gifdataset.cpp.diff
===================================================================
--- trunk/dports/gis/gdal/files/patch-frmts_gif_gifdataset.cpp.diff	                        (rev 0)
+++ trunk/dports/gis/gdal/files/patch-frmts_gif_gifdataset.cpp.diff	2012-05-22 13:48:39 UTC (rev 93426)
@@ -0,0 +1,53 @@
+--- frmts/gif/gifdataset.cpp.orig	2012-05-22 17:29:20.000000000 +0400
++++ frmts/gif/gifdataset.cpp	2012-05-22 17:29:28.000000000 +0400
+@@ -470,6 +470,28 @@
+ }
+ 
+ /************************************************************************/
++/*                        GDALPrintGifError()                           */
++/************************************************************************/
++
++static void GDALPrintGifError(const char* pszMsg)
++{
++/* GIFLIB_MAJOR is only defined in libgif >= 4.2.0 */
++/* libgif 4.2.0 has retired PrintGifError() and added GifErrorString() */
++#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && \
++        ((GIFLIB_MAJOR == 4 && GIFLIB_MINOR >= 2) || GIFLIB_MAJOR > 4)
++    /* Static string actually, hence the const char* cast */
++    const char* pszGIFLIBError = (const char*) GifErrorString();
++    if (pszGIFLIBError == NULL)
++        pszGIFLIBError = "Unknown error";
++    CPLError( CE_Failure, CPLE_AppDefined,
++              "%s. GIFLib Error : %s", pszMsg, pszGIFLIBError );
++#else
++    PrintGifError();
++    CPLError( CE_Failure, CPLE_AppDefined, "%s", pszMsg );
++#endif
++}
++
++/************************************************************************/
+ /*                             CreateCopy()                             */
+ /************************************************************************/
+ 
+@@ -596,9 +618,7 @@
+                           psGifCT->ColorCount, 255, psGifCT) == GIF_ERROR)
+     {
+         FreeMapObject(psGifCT);
+-        PrintGifError();
+-        CPLError( CE_Failure, CPLE_AppDefined, 
+-                  "Error writing gif file." );
++        GDALPrintGifError("Error writing gif file.");
+         EGifCloseFile(hGifFile);
+         VSIFCloseL( fp );
+         return NULL;
+@@ -622,9 +642,7 @@
+ 
+     if (EGifPutImageDesc(hGifFile, 0, 0, nXSize, nYSize, bInterlace, NULL) == GIF_ERROR )
+     {
+-        PrintGifError();
+-        CPLError( CE_Failure, CPLE_AppDefined, 
+-                  "Error writing gif file." );
++        GDALPrintGifError("Error writing gif file.");
+         EGifCloseFile(hGifFile);
+         VSIFCloseL( fp );
+         return NULL;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120522/fa05caa9/attachment-0001.html>


More information about the macports-changes mailing list