[mapserver-commits] r11219 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Fri Mar 18 10:07:45 EDT 2011


Author: tbonfort
Date: 2011-03-18 07:07:45 -0700 (Fri, 18 Mar 2011)
New Revision: 11219

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapoutput.c
Log:
add a default png8 outputformat that uses AGG/PNG with quantization

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2011-03-18 13:41:32 UTC (rev 11218)
+++ trunk/mapserver/HISTORY.TXT	2011-03-18 14:07:45 UTC (rev 11219)
@@ -13,6 +13,8 @@
 
 Current Version (SVN trunk):
 ----------------------------
+- add a default png8 outputformat that uses AGG/PNG with quantization
+
 - change MS_INIT_COLOR to take alpha as a parameter
 
 - stop using style->opacity in rendering code, use alpha from colorObjs.

Modified: trunk/mapserver/mapoutput.c
===================================================================
--- trunk/mapserver/mapoutput.c	2011-03-18 13:41:32 UTC (rev 11218)
+++ trunk/mapserver/mapoutput.c	2011-03-18 14:07:45 UTC (rev 11219)
@@ -100,6 +100,7 @@
    {"png","AGG/PNG","image/png"},
    {"jpeg","AGG/JPEG","image/jpeg"},
    {"gif","GD/GIF","image/gif"},
+   {"png8","AGG/PNG8","image/png; mode=8bit"},
    {"png24","AGG/PNG","image/png; mode=24bit"},
 #ifdef USE_CAIRO
    {"pdf","CAIRO/PDF","application/x-pdf"},
@@ -200,6 +201,17 @@
         format->extension = msStrdup("png");
         format->renderer = MS_RENDER_WITH_AGG;
     }
+    if( strcasecmp(driver,"AGG/PNG8") == 0 )
+    {
+        format = msAllocOutputFormat( map, "png8", driver );
+        format->mimetype = msStrdup("image/png; mode=8bit");
+        format->imagemode = MS_IMAGEMODE_RGB;
+        format->extension = msStrdup("png");
+        format->renderer = MS_RENDER_WITH_AGG;
+        msSetOutputFormatOption( format, "QUANTIZE_FORCE", "on");
+        msSetOutputFormatOption( format, "QUANTIZE_COLORS", "256");
+    }
+    
     if( strcasecmp(driver,"AGG/JPEG") == 0 )
     {
         format = msAllocOutputFormat( map, "jpeg", driver );



More information about the mapserver-commits mailing list