[mapserver-commits] r9176 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Jul 14 00:36:35 EDT 2009


Author: sdlime
Date: 2009-07-14 00:36:33 -0400 (Tue, 14 Jul 2009)
New Revision: 9176

Modified:
   trunk/mapserver/maptemplate.c
Log:
Updated query format search to include mime-type. (#3024)

Modified: trunk/mapserver/maptemplate.c
===================================================================
--- trunk/mapserver/maptemplate.c	2009-07-13 21:02:54 UTC (rev 9175)
+++ trunk/mapserver/maptemplate.c	2009-07-14 04:36:33 UTC (rev 9176)
@@ -196,7 +196,7 @@
 {
   imageObj *img = NULL;
   int i, status;
-
+  
   outputFormatObj *outputFormat=NULL;
 
   if(!queryFormat) {
@@ -204,15 +204,9 @@
     return MS_FAILURE;
   }
 
-  /*
-  ** The functions in mapoutput.c rely on mime-type too and we don't want that with queries. So
-  ** we do a name search only.
-  */
-  for( i = 0; i < mapserv->map->numoutputformats; i++ ) {
-    if( strcasecmp(queryFormat, mapserv->map->outputformatlist[i]->name) == 0 )
-      outputFormat = mapserv->map->outputformatlist[i];
-  }
-
+  i = msGetOutputFormatIndex(mapserv->map, queryFormat); /* queryFormat can be a mime-type or name */
+  if(i >= 0) outputFormat = mapserv->map->outputformatlist[i];
+  
   if(outputFormat) {
      if( !MS_RENDERER_TEMPLATE(outputFormat) ) { /* got an image format, return the query results that way */
        outputFormatObj *tempOutputFormat = mapserv->map->outputformat; /* save format */



More information about the mapserver-commits mailing list