Skip to content

Commit

Permalink
Remove map->transparent property
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika committed May 14, 2021
1 parent a9db1fa commit e093f6f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 43 deletions.
1 change: 0 additions & 1 deletion mapcopy.c
Expand Up @@ -1214,7 +1214,6 @@ int msCopyMap(mapObj *dst, const mapObj *src)
}

/* msCopyLabelCache(&(dst->labelcache), &(src->labelcache)); */
MS_COPYSTELEM(transparent);
MS_COPYSTELEM(interlace);
MS_COPYSTELEM(imagequality);

Expand Down
32 changes: 14 additions & 18 deletions mapdraw.c
Expand Up @@ -76,25 +76,21 @@ imageObj *msPrepareImage(mapObj *map, int allow_nonsquare)
rendererVTableObj *renderer = map->outputformat->vtable;
colorObj *bg = &map->imagecolor;
map->imagecolor.alpha=255;
if(map->transparent == MS_TRUE) {
/* don't set the image color */
bg = NULL;
}

image = renderer->createImage(map->width, map->height, map->outputformat,bg);
if (image == NULL)
return(NULL);
image->format = map->outputformat;
image->format->refcount++;
image->width = map->width;
image->height = map->height;

image->resolution = map->resolution;
image->resolutionfactor = map->resolution/map->defresolution;
if (map->web.imagepath)
image->imagepath = msStrdup(map->web.imagepath);
if (map->web.imageurl)
image->imageurl = msStrdup(map->web.imageurl);
image = renderer->createImage(map->width, map->height, map->outputformat,bg);
if (image == NULL)
return(NULL);
image->format = map->outputformat;
image->format->refcount++;
image->width = map->width;
image->height = map->height;
image->resolution = map->resolution;
image->resolutionfactor = map->resolution/map->defresolution;
if (map->web.imagepath)
image->imagepath = msStrdup(map->web.imagepath);
if (map->web.imageurl)
image->imageurl = msStrdup(map->web.imageurl);

} else if( MS_RENDERER_IMAGEMAP(map->outputformat) ) {
image = msImageCreateIM(map->width, map->height, map->outputformat,
Expand Down
15 changes: 1 addition & 14 deletions mapfile.c
Expand Up @@ -4958,7 +4958,7 @@ static int loadOutputFormat(mapObj *map)
if( imagemode != MS_NOOVERRIDE ) {
if(format->renderer != MS_RENDER_WITH_AGG || imagemode != MS_IMAGEMODE_PC256) {
/* don't force to PC256 with agg, this can happen when using mapfile defined GD
* ouputformats that are now falling back to agg/png8
* outputformats that are now falling back to agg/png8
*/
format->imagemode = imagemode;
}
Expand Down Expand Up @@ -5858,7 +5858,6 @@ int initMap(mapObj *map)

map->palette.numcolors = 0;

map->transparent = MS_NOOVERRIDE;
map->interlace = MS_NOOVERRIDE;
map->imagequality = MS_NOOVERRIDE;

Expand Down Expand Up @@ -6081,7 +6080,6 @@ static void writeMap(FILE *stream, int indent, mapObj *map)
writeKeyword(stream, indent, "STATUS", map->status, 2, MS_ON, "ON", MS_OFF, "OFF");
writeString(stream, indent, "SYMBOLSET", NULL, map->symbolset.filename);
writeString(stream, indent, "TEMPLATEPATTERN", NULL, map->templatepattern); /* depricated */
writeKeyword(stream, indent, "TRANSPARENT", map->transparent, 2, MS_TRUE, "TRUE", MS_FALSE, "FALSE");
writeKeyword(stream, indent, "UNITS", map->units, 7, MS_INCHES, "INCHES", MS_FEET ,"FEET", MS_MILES, "MILES", MS_METERS, "METERS", MS_KILOMETERS, "KILOMETERS", MS_NAUTICALMILES, "NAUTICALMILES", MS_DD, "DD");
writeLineFeed(stream);

Expand Down Expand Up @@ -6350,9 +6348,6 @@ static int loadMapInternal(mapObj *map)
case(SYMBOLSET):
if(getString(&map->symbolset.filename) == MS_FAILURE) return MS_FAILURE;
break;
case(TRANSPARENT):
if((map->transparent = getSymbol(2, MS_ON,MS_OFF)) == -1) return MS_FAILURE;
break;
case(UNITS):
if((int)(map->units = getSymbol(7, MS_INCHES,MS_FEET,MS_MILES,MS_METERS,MS_KILOMETERS,MS_NAUTICALMILES,MS_DD)) == -1) return MS_FAILURE;
break;
Expand Down Expand Up @@ -6742,14 +6737,6 @@ int msUpdateMapFromURL(mapObj *map, char *variable, char *string)
}
msMapComputeGeotransform( map );
break;
case(TRANSPARENT):
msyystate = MS_TOKENIZE_URL_STRING;
msyystring = string;
msyylex();

if((map->transparent = getSymbol(2, MS_ON,MS_OFF)) == -1) break;
msPostMapParseOutputFormatSetup( map );
break;
case(UNITS):
msyystate = MS_TOKENIZE_URL_STRING;
msyystring = string;
Expand Down
14 changes: 7 additions & 7 deletions mapoutput.c
Expand Up @@ -153,7 +153,7 @@ int msPostMapParseOutputFormatSetup( mapObj *map )
}

msApplyOutputFormat( &(map->outputformat), format,
map->transparent, map->interlace, map->imagequality );
format->transparent, map->interlace, map->imagequality );

return MS_SUCCESS;
}
Expand Down Expand Up @@ -664,8 +664,8 @@ void msApplyOutputFormat( outputFormatObj **target,
/* Do we need to change any values? If not, then just apply */
/* and return. */
/* -------------------------------------------------------------------- */
if( transparent != MS_NOOVERRIDE && !format->transparent != !transparent )
change_needed = MS_TRUE;
if( transparent != MS_NOOVERRIDE && !format->transparent != !transparent )
change_needed = MS_TRUE;

old_imagequality = atoi(msGetOutputFormatOption( format, "QUALITY", "75"));
if( imagequality != MS_NOOVERRIDE && old_imagequality != imagequality )
Expand All @@ -683,10 +683,10 @@ void msApplyOutputFormat( outputFormatObj **target,
if( format->refcount > 0 )
format = msCloneOutputFormat( format );

if( transparent != MS_NOOVERRIDE ) {
format->transparent = transparent;
if( format->imagemode == MS_IMAGEMODE_RGB )
format->imagemode = MS_IMAGEMODE_RGBA;
if( transparent != MS_NOOVERRIDE ) {
format->transparent = transparent;
if( format->imagemode == MS_IMAGEMODE_RGB )
format->imagemode = MS_IMAGEMODE_RGBA;
}

if( imagequality != MS_NOOVERRIDE && imagequality != old_imagequality ) {
Expand Down
2 changes: 1 addition & 1 deletion mapscript/php/mapscript_i.c
Expand Up @@ -395,7 +395,7 @@ int mapObj_selectOutputFormat(mapObj *self,
format = msSelectOutputFormat(self, imagetype);
if (format) {
msApplyOutputFormat( &(self->outputformat), format,
self->transparent, self->interlace,
format->transparent, self->interlace,
self->imagequality );
return(MS_SUCCESS);
}
Expand Down
1 change: 0 additions & 1 deletion mapserver.h
Expand Up @@ -1942,7 +1942,6 @@ void msPopulateTextSymbolForLabelAndString(textSymbolObj *ts, labelObj *l, char
%mutable;
#endif /* SWIG */

int transparent; ///< TODO - Deprecated
int interlace; ///< TODO - Deprecated
int imagequality; ///< TODO - Deprecated
char *datapattern; ///< TODO - Deprecated use VALIDATION ... END block instead
Expand Down
2 changes: 1 addition & 1 deletion shp2img.c
Expand Up @@ -176,7 +176,7 @@ int main(int argc, char *argv[])
msFree( (char *) map->imagetype );
map->imagetype = msStrdup( argv[i+1] );
msApplyOutputFormat( &(map->outputformat), format,
map->transparent, map->interlace,
format->transparent, map->interlace,
map->imagequality );
}
i+=1;
Expand Down

0 comments on commit e093f6f

Please sign in to comment.