[mapguide-commits] r8584 - sandbox/adsk/3.0m/Server/src/Services/Feature

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Mar 17 23:19:32 PDT 2015


Author: hubu
Date: 2015-03-17 23:19:32 -0700 (Tue, 17 Mar 2015)
New Revision: 8584

Modified:
   sandbox/adsk/3.0m/Server/src/Services/Feature/ServerFeatureUtil.cpp
Log:
#2551,Zoom in/out raster file (sid file) in flexible web layout results in server down.
http://trac.osgeo.org/mapguide/ticket/2551, submit on behalf of Andy Zhang.

For raster data sources, the property exists only when the data model type is FdoRasterDataModelType_Palette. But we call the GetProperty(L"Palette") when bits of pixel is 8. So for some raster files, FdoCommandException will be thrown several times, which results in Server unstable. Now we add a check of the data model type to fix the issue. 

Modified: sandbox/adsk/3.0m/Server/src/Services/Feature/ServerFeatureUtil.cpp
===================================================================
--- sandbox/adsk/3.0m/Server/src/Services/Feature/ServerFeatureUtil.cpp	2015-03-17 16:36:00 UTC (rev 8583)
+++ sandbox/adsk/3.0m/Server/src/Services/Feature/ServerFeatureUtil.cpp	2015-03-18 06:19:32 UTC (rev 8584)
@@ -20,6 +20,7 @@
 #include "ServerDataReaderPool.h"
 #include "ServerFeatureReaderPool.h"
 #include "ByteSourceRasterStreamImpl.h"
+#include "Fdo/Raster/RasterDataModelType.h"
 
 static std::map<FdoPropertyType, INT32>                 s_FdoPropertyType;
 static std::map<FdoDataType, INT32>                     s_FeatureUtilFdoDataType;
@@ -485,8 +486,8 @@
             retVal->SetBitsPerPixel(dm->GetBitsPerPixel());
             retVal->SetDataModelType(dm->GetDataModelType());
 
-            //if image is color mapped, get the palette
-            if (dm->GetBitsPerPixel() == 8)
+            //if data model type is Palette and image is color mapped, get the palette
+            if (dm->GetDataModelType() == FdoRasterDataModelType_Palette && dm->GetBitsPerPixel() == 8)
             {
                 //try to get the palette -- if there isn't one,
                 //an exception will be thrown. It's simpler to catch



More information about the mapguide-commits mailing list