[mapguide-commits] r7570 - branches/2.5/MgDev/Server/src/Services/Mapping
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Jun 6 08:15:16 PDT 2013
Author: jng
Date: 2013-06-06 08:15:15 -0700 (Thu, 06 Jun 2013)
New Revision: 7570
Modified:
branches/2.5/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
branches/2.5/MgDev/Server/src/Services/Mapping/MappingUtil.h
branches/2.5/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp
Log:
#2270: And here's the fix
Modified: branches/2.5/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
===================================================================
--- branches/2.5/MgDev/Server/src/Services/Mapping/MappingUtil.cpp 2013-06-06 15:13:31 UTC (rev 7569)
+++ branches/2.5/MgDev/Server/src/Services/Mapping/MappingUtil.cpp 2013-06-06 15:15:15 UTC (rev 7570)
@@ -1200,7 +1200,8 @@
MdfModel::FeatureTypeStyle* fts,
INT32 imgWidth,
INT32 imgHeight,
- INT32 themeCategory)
+ INT32 themeCategory,
+ CREFSTRING format)
{
if (!fts)
return NULL;
@@ -1218,9 +1219,6 @@
// draw the preview
StylizationUtil::DrawStylePreview(imgWidth, imgHeight, themeCategory, fts, &er, &se_sman);
- // TODO: use user-specified format
- RS_String format = L"PNG";
-
auto_ptr<RS_ByteData> data;
data.reset(er.Save(format, imgWidth, imgHeight));
@@ -1228,8 +1226,14 @@
{
// put this into a byte source
Ptr<MgByteSource> bs = new MgByteSource(data->GetBytes(), data->GetNumBytes());
- bs->SetMimeType(MgMimeType::Png);
+ if (format == MgImageFormats::Gif)
+ bs->SetMimeType(MgMimeType::Gif);
+ else if (format == MgImageFormats::Jpeg)
+ bs->SetMimeType(MgMimeType::Jpeg);
+ else if (format == MgImageFormats::Png || format == MgImageFormats::Png8)
+ bs->SetMimeType(MgMimeType::Png);
+
return bs->GetReader();
}
Modified: branches/2.5/MgDev/Server/src/Services/Mapping/MappingUtil.h
===================================================================
--- branches/2.5/MgDev/Server/src/Services/Mapping/MappingUtil.h 2013-06-06 15:13:31 UTC (rev 7569)
+++ branches/2.5/MgDev/Server/src/Services/Mapping/MappingUtil.h 2013-06-06 15:15:15 UTC (rev 7570)
@@ -86,7 +86,7 @@
static MdfModel::MapDefinition* GetMapDefinition(MgResourceService* svcResource, MgResourceIdentifier* resId);
- static MgByteReader* DrawFTS(MgResourceService* svcResource, MdfModel::FeatureTypeStyle* fts, INT32 imgWidth, INT32 imgHeight, INT32 themeCategory);
+ static MgByteReader* DrawFTS(MgResourceService* svcResource, MdfModel::FeatureTypeStyle* fts, INT32 imgWidth, INT32 imgHeight, INT32 themeCategory, CREFSTRING format = L"PNG");
static double ComputeStylizationOffset(MgMap* map, MdfModel::VectorScaleRange* scaleRange, double scale);
static MgEnvelope* TransformExtent(MgEnvelope* extent, MgCoordinateSystemTransform* xform);
Modified: branches/2.5/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp
===================================================================
--- branches/2.5/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp 2013-06-06 15:13:31 UTC (rev 7569)
+++ branches/2.5/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp 2013-06-06 15:15:15 UTC (rev 7570)
@@ -1671,7 +1671,7 @@
}
if (fts)
- byteReader = MgMappingUtil::DrawFTS(m_svcResource, fts, imgWidth, imgHeight, themeCategory);
+ byteReader = MgMappingUtil::DrawFTS(m_svcResource, fts, imgWidth, imgHeight, themeCategory, format);
else
{
//return the fixed array
More information about the mapguide-commits
mailing list