MCPcopy Index your code
hub / github.com/MapServer/MapServer / msSelectOutputFormat

Function msSelectOutputFormat

mapoutput.c:593–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

591
592
593outputFormatObj *msSelectOutputFormat( mapObj *map,
594 const char *imagetype )
595
596{
597 int index;
598 outputFormatObj *format = NULL;
599
600 if( map == NULL || imagetype == NULL || strlen(imagetype) == 0 )
601 return NULL;
602
603/* -------------------------------------------------------------------- */
604/* Try to find the format in the maps list of formats, first by */
605/* mime type, and then by output format name. */
606/* -------------------------------------------------------------------- */
607 index = msGetOutputFormatIndex(map, imagetype);
608 if (index >= 0) {
609 format = map->outputformatlist[index];
610 } else {
611 struct defaultOutputFormatEntry *formatEntry = defaultoutputformats;
612 while(formatEntry->name) {
613 if(!strcasecmp(imagetype,formatEntry->name) || !strcasecmp(imagetype,formatEntry->mimetype)) {
614 format = msCreateDefaultOutputFormat( map, formatEntry->driver, formatEntry->name );
615 break;
616 }
617 formatEntry++;
618 }
619
620 }
621
622 if (format)
623 {
624 if (map->imagetype)
625 free(map->imagetype);
626 map->imagetype = msStrdup(format->name);
627 }
628
629 if( format != NULL )
630 msOutputFormatValidate( format, MS_FALSE );
631
632 return format;
633}
634
635/************************************************************************/
636/* msApplyOutputFormat() */

Callers 15

msDrawLayerFunction · 0.85
msDrawLegendIconFunction · 0.85
mainFunction · 0.85
msOwsIsOutputFormatValidFunction · 0.85
msCopyMapFunction · 0.85
msWCSGetCoverageFunction · 0.85
msWCSGetCoverage20Function · 0.85
msWMSLoadGetMapParamsFunction · 0.85

Calls 5

msGetOutputFormatIndexFunction · 0.85
strcasecmpFunction · 0.85
msStrdupFunction · 0.85
msOutputFormatValidateFunction · 0.85

Tested by

no test coverage detected