Changeset 7573

Show
Ignore:
Timestamp:
05/09/08 09:33:55 (3 months ago)
Author:
sdlime
Message:

The functions in mapoutput.c check mime-type which was breaking things with RFC 36 code. For QUERY output we want to lookup output formats by name only.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/mapserver/maptemplate.c

    r7572 r7573  
    182182{ 
    183183  imageObj *img = NULL; 
    184   int status; 
     184  int i, status; 
    185185  char buffer[1024]; 
    186186 
    187   outputFormatObj *outputFormat
     187  outputFormatObj *outputFormat=NULL
    188188 
    189189  if(!queryFormat) { 
     
    192192  } 
    193193 
    194   if((outputFormat = msSelectOutputFormat( mapserv->Map, queryFormat)) != NULL) { 
    195  
    196     if( !MS_RENDERER_TEMPLATE(outputFormat) ) { /* got an image format, return the query results that way */ 
    197  
     194  /* 
     195  ** The functions in mapoutput.c rely on mime-type too and we don't want that with queries. So 
     196  ** we do a name search only. 
     197  */ 
     198  for( i = 0; i < mapserv->Map->numoutputformats; i++ ) { 
     199    if( strcasecmp(queryFormat, mapserv->Map->outputformatlist[i]->name) == 0 ) 
     200      outputFormat = mapserv->Map->outputformatlist[i]; 
     201  } 
     202 
     203  if(outputFormat) { 
     204     if( !MS_RENDERER_TEMPLATE(outputFormat) ) { /* got an image format, return the query results that way */ 
     205      printf("got an image output format\n"); 
     206      return MS_SUCCESS; 
    198207    } 
    199208  } 
     
    242251    
    243252  if(outputFormat) { 
    244     printf("got an output format!\n"); 
     253    printf("got a template output format!\n"); 
    245254  } else { 
    246255    if((status = msReturnQuery(mapserv, queryFormat, papszBuffer)) != MS_SUCCESS)