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

Function msGetOutputFormatMimeListImg

mapoutput.c:881–930  ·  view source on GitHub ↗

/ msGetOutputFormatMimeList() */ /

Source from the content-addressed store, hash-verified

879/* msGetOutputFormatMimeList() */
880/************************************************************************/
881void msGetOutputFormatMimeListImg( mapObj *map, char **mime_list, int max_mime )
882
883{
884 int mime_count = 0, i,j;
885 const char *format_list = NULL;
886 char **tokens = NULL;
887 int numtokens = 0;
888 outputFormatObj *format;
889
890 msApplyDefaultOutputFormats(map);
891 format_list = msOWSLookupMetadata(&(map->web.metadata), "M","getlegendgraphic_formatlist");
892 if ( format_list && strlen(format_list) > 0)
893 tokens = msStringSplit(format_list, ',', &numtokens);
894
895 if (tokens && numtokens > 0)
896 {
897 for(j = 0; j < numtokens; j++ )
898 {
899 format = msSelectOutputFormat(map, tokens[j]);
900 if (format != NULL)
901 {
902 mime_list[mime_count++] = format->mimetype;
903 }
904 }
905 msFreeCharArray(tokens, numtokens);
906 }
907 else
908 for( i = 0; i < map->numoutputformats && mime_count < max_mime; i++ )
909 {
910 int j;
911
912 if( map->outputformatlist[i]->mimetype == NULL )
913 continue;
914
915 for( j = 0; j < mime_count; j++ )
916 {
917 if( strcasecmp(mime_list[j],
918 map->outputformatlist[i]->mimetype) == 0 )
919 break;
920 }
921
922 if( j == mime_count && map->outputformatlist[i]->driver &&
923 (strncasecmp(map->outputformatlist[i]->driver, "GD/", 3)==0 ||
924 strncasecmp(map->outputformatlist[i]->driver, "AGG/", 4)==0))
925 mime_list[mime_count++] = map->outputformatlist[i]->mimetype;
926 }
927
928 if( mime_count < max_mime )
929 mime_list[mime_count] = NULL;
930}
931
932/************************************************************************/
933/* msGetOutputFormatMimeListWMS() */

Callers 1

msWMSGetCapabilitiesFunction · 0.85

Calls 7

msOWSLookupMetadataFunction · 0.85
msStringSplitFunction · 0.85
msSelectOutputFormatFunction · 0.85
msFreeCharArrayFunction · 0.85
strcasecmpFunction · 0.85
strncasecmpFunction · 0.85

Tested by

no test coverage detected