[mapserver-commits] r11045 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Thu Mar 3 14:19:14 EST 2011


Author: warmerdam
Date: 2011-03-03 11:19:13 -0800 (Thu, 03 Mar 2011)
New Revision: 11045

Modified:
   trunk/mapserver/mapraster.c
Log:
always define red/green/blue color value for raster expressions

Modified: trunk/mapserver/mapraster.c
===================================================================
--- trunk/mapserver/mapraster.c	2011-03-03 19:11:37 UTC (rev 11044)
+++ trunk/mapserver/mapraster.c	2011-03-03 19:19:13 UTC (rev 11045)
@@ -78,23 +78,16 @@
 /* -------------------------------------------------------------------- */
 /*      Setup values list for expressions.                              */
 /* -------------------------------------------------------------------- */
-    if( color->red != -1 )
-    {
-        sprintf( red_value, "%d", color->red );
-        sprintf( green_value, "%d", color->green );
-        sprintf( blue_value, "%d", color->blue );
-        item_values[1] = red_value;
-        item_values[2] = green_value;
-        item_values[3] = blue_value;
-        numitems = 4;
-    }
-    else
-    {
-        numitems = 1;
-    }
-        
-    item_values[0] = (char *)pixel_value;
+    numitems = 4;
+    sprintf( red_value, "%d", color->red );
+    sprintf( green_value, "%d", color->green );
+    sprintf( blue_value, "%d", color->blue );
 
+    item_values[0] = (char *)pixel_value;
+    item_values[1] = red_value;
+    item_values[2] = green_value;
+    item_values[3] = blue_value;
+        
 /* -------------------------------------------------------------------- */
 /*      Loop over classes till we find a match.                         */
 /* -------------------------------------------------------------------- */



More information about the mapserver-commits mailing list