[mapserver-commits] r8633 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Thu Mar 5 01:32:32 EST 2009


Author: sdlime
Date: 2009-03-05 01:32:31 -0500 (Thu, 05 Mar 2009)
New Revision: 8633

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/maplegend.c
   trunk/mapserver/mapscale.c
Log:
Fixed a problem with long running processes, embedded scalebars/legends and AGG. (#2887)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2009-03-05 06:16:47 UTC (rev 8632)
+++ trunk/mapserver/HISTORY.TXT	2009-03-05 06:32:31 UTC (rev 8633)
@@ -12,6 +12,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Fixed a problem with long running processes, embedded scalebars/legends and AGG. (#2887)
+
 - Applied patch to deal with a couple of WCS issues (time ranges, #2487) and PostGIS tileindex-based time filters (#1856)
 
 - Adding -DUSE_GENERIC_MS_NINT to the WIN64 MapScript builds (#2250)

Modified: trunk/mapserver/maplegend.c
===================================================================
--- trunk/mapserver/maplegend.c	2009-03-05 06:16:47 UTC (rev 8632)
+++ trunk/mapserver/maplegend.c	2009-03-05 06:32:31 UTC (rev 8633)
@@ -402,17 +402,15 @@
   imageObj *image = NULL;
 
   s = msGetSymbolIndex(&(map->symbolset), "legend", MS_FALSE);
-  if(s == -1) {
-    if(msGrowSymbolSet(&map->symbolset) == NULL)
-        return -1;
-    s = map->symbolset.numsymbols;
-    map->symbolset.numsymbols++;
-    initSymbol(map->symbolset.symbol[s]);
-  } else {
-    if(map->symbolset.symbol[s]->img) 
-      gdImageDestroy(map->symbolset.symbol[s]->img);
-  }
+  if(s != -1) 
+    msRemoveSymbol(&(map->symbolset), s); /* solves some caching issues in AGG with long-running processes */
 
+  if(msGrowSymbolSet(&map->symbolset) == NULL)
+    return -1;
+  s = map->symbolset.numsymbols;
+  map->symbolset.numsymbols++;
+  initSymbol(map->symbolset.symbol[s]);
+
 #ifdef USE_AGG
   if(MS_RENDERER_AGG(map->outputformat))
     msAlphaGD2AGG(img);

Modified: trunk/mapserver/mapscale.c
===================================================================
--- trunk/mapserver/mapscale.c	2009-03-05 06:16:47 UTC (rev 8632)
+++ trunk/mapserver/mapscale.c	2009-03-05 06:32:31 UTC (rev 8633)
@@ -391,16 +391,14 @@
   imageObj *image = NULL;
 
   s = msGetSymbolIndex(&(map->symbolset), "scalebar", MS_FALSE);
-  if(s == -1) {
-    if (msGrowSymbolSet(&map->symbolset) == NULL)
-        return -1;
-    s = map->symbolset.numsymbols;
-    map->symbolset.numsymbols++;
-    initSymbol(map->symbolset.symbol[s]);
-  } else {
-    if(map->symbolset.symbol[s]->img) 
-      gdImageDestroy(map->symbolset.symbol[s]->img);
-  }
+  if(s != -1) 
+    msRemoveSymbol(&(map->symbolset), s); /* solves some caching issues in AGG with long-running processes */
+
+  if(msGrowSymbolSet(&map->symbolset) == NULL)
+    return -1;
+  s = map->symbolset.numsymbols;
+  map->symbolset.numsymbols++;
+  initSymbol(map->symbolset.symbol[s]);
   
   image = msDrawScalebar(map);
   map->symbolset.symbol[s]->img =  image->img.gd; /* TODO  */
@@ -413,8 +411,7 @@
 
   /* in 8 bit, mark 0 as being transparent.  In 24bit hopefully already
      have transparency enabled ... */
-  if(map->scalebar.transparent == MS_ON 
-     && !gdImageTrueColor(image->img.gd ) )
+  if(map->scalebar.transparent == MS_ON && !gdImageTrueColor(image->img.gd ) )
     gdImageColorTransparent(map->symbolset.symbol[s]->img, 0);
 
   switch(map->scalebar.position) {
@@ -464,12 +461,10 @@
     map->layerorder[l] = l;
   }
 
-  /* to resolve bug 490 */
-  GET_LAYER(map, l)->opacity = MS_GD_ALPHA;
-  
+  GET_LAYER(map, l)->opacity = MS_GD_ALPHA; /* to resolve bug 490 */
   GET_LAYER(map, l)->status = MS_ON;
 
-/* TODO: Change this when we get rid of MS_MAXSTYLES */
+  /* TODO: Change this when we get rid of MS_MAXSTYLES */
   if (msMaybeAllocateStyle(GET_LAYER(map, l)->class[0], 0)==MS_FAILURE) return MS_FAILURE;
   GET_LAYER(map, l)->class[0]->styles[0]->symbol = s;
   GET_LAYER(map, l)->class[0]->styles[0]->color.pen = -1;
@@ -486,12 +481,12 @@
        * layer of the map was a raster layer
        */
       if(MS_RENDERER_AGG(map->outputformat))
-          msAlphaGD2AGG(img);
+        msAlphaGD2AGG(img);
 #endif
       msDrawMarkerSymbol(&map->symbolset, img, &point, GET_LAYER(map, l)->class[0]->styles[0], 1.0);
-  }
-  else
+  } else {
     msAddLabel(map, l, 0, NULL, &point, NULL, " ", 1.0, NULL);
+  }
 
   /* Mark layer as deleted so that it doesn't interfere with html legends or with saving maps */
   GET_LAYER(map, l)->status = MS_DELETE;



More information about the mapserver-commits mailing list