[mapserver-commits] r11509 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Fri Apr 8 14:07:25 EDT 2011
Author: aboudreault
Date: 2011-04-08 11:07:25 -0700 (Fri, 08 Apr 2011)
New Revision: 11509
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/mapimageio.c
Log:
GD Driver broken in FastCGI (#3813)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2011-04-08 11:42:46 UTC (rev 11508)
+++ trunk/mapserver/HISTORY.TXT 2011-04-08 18:07:25 UTC (rev 11509)
@@ -15,6 +15,8 @@
Current Version (SVN trunk):
----------------------------
+- GD Driver broken in FastCGI (#3813)
+
- configure: look for libexslt.so under lib64 as well
- Coding style and formatting fixes (#3819, #3820, #3821, and more)
Modified: trunk/mapserver/mapimageio.c
===================================================================
--- trunk/mapserver/mapimageio.c 2011-04-08 11:42:46 UTC (rev 11508)
+++ trunk/mapserver/mapimageio.c 2011-04-08 18:07:25 UTC (rev 11509)
@@ -767,7 +767,11 @@
}
int saveGdImage(gdImagePtr ip, FILE *fp, outputFormatObj *format) {
+ gdIOCtx *ctx = NULL;
+ if (fp && (fp == stdout))
+ ctx = msIO_getGDIOCtx( fp );
+
if(strcasecmp("ON", msGetOutputFormatOption(format, "INTERLACE", "ON")) == 0)
gdImageInterlace(ip, 1);
@@ -776,21 +780,30 @@
if(strcasestr(format->driver, "/gif")) {
#ifdef USE_GD_GIF
- gdImageGif(ip, fp);
+ if (ctx)
+ gdImageGifCtx(ip, ctx);
+ else
+ gdImageGif(ip, fp);
#else
msSetError(MS_MISCERR, "GIF output is not available.", "saveImageGD()");
return(MS_FAILURE);
#endif
} else if(strcasestr(format->driver, "/png")) {
#ifdef USE_GD_PNG
- gdImagePng(ip, fp);
+ if (ctx)
+ gdImagePngCtx(ip, ctx);
+ else
+ gdImagePng(ip, fp);
#else
msSetError(MS_MISCERR, "PNG output is not available.", "saveImageGD()");
return(MS_FAILURE);
#endif
} else if(strcasestr(format->driver, "/jpeg")) {
#ifdef USE_GD_JPEG
- gdImageJpeg(ip, fp, atoi(msGetOutputFormatOption( format, "QUALITY", "75")));
+ if (ctx)
+ gdImageJpegCtx(ip, ctx, atoi(msGetOutputFormatOption( format, "QUALITY", "75")));
+ else
+ gdImageJpeg(ip, fp, atoi(msGetOutputFormatOption( format, "QUALITY", "75")));
#else
msSetError(MS_MISCERR, "JPEG output is not available.", "saveImageGD()");
return(MS_FAILURE);
More information about the mapserver-commits
mailing list