From: Dirk Lemstra Date: Tue, 23 Oct 2018 05:12:02 +0000 (+0200) Subject: Use value instead of macro. X-Git-Tag: 7.0.8-14~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf63217a2d0bca22c02a48288d3b09772372683a;p=imagemagick Use value instead of macro. --- diff --git a/coders/svg.c b/coders/svg.c index 68129e520..b2b1622b1 100644 --- a/coders/svg.c +++ b/coders/svg.c @@ -74,7 +74,6 @@ #include "MagickCore/string-private.h" #include "MagickCore/token.h" #include "MagickCore/utility.h" -#include "MagickCore/version.h" #if defined(MAGICKCORE_XML_DELEGATE) # if defined(MAGICKCORE_WINDOWS_SUPPORT) # if !defined(__MINGW32__) @@ -102,11 +101,6 @@ #endif #endif -/* - Define declarations. -*/ -#define SVGDensity 90.0 - /* Typedef declarations. */ @@ -338,17 +332,17 @@ static double GetUserSpaceCoordinateValue(const SVGInfo *svg_info,int type, } GetNextToken(p,&p,MagickPathExtent,token); if (LocaleNCompare(token,"cm",2) == 0) - return(SVGDensity*svg_info->scale[0]/2.54*value); + return(90.0*svg_info->scale[0]/2.54*value); if (LocaleNCompare(token,"em",2) == 0) return(svg_info->pointsize*value); if (LocaleNCompare(token,"ex",2) == 0) return(svg_info->pointsize*value/2.0); if (LocaleNCompare(token,"in",2) == 0) - return(SVGDensity*svg_info->scale[0]*value); + return(90.0*svg_info->scale[0]*value); if (LocaleNCompare(token,"mm",2) == 0) - return(SVGDensity*svg_info->scale[0]/25.4*value); + return(90.0*svg_info->scale[0]/25.4*value); if (LocaleNCompare(token,"pc",2) == 0) - return(SVGDensity*svg_info->scale[0]/6.0*value); + return(90.0*svg_info->scale[0]/6.0*value); if (LocaleNCompare(token,"pt",2) == 0) return(svg_info->scale[0]*value); if (LocaleNCompare(token,"px",2) == 0) @@ -3094,7 +3088,7 @@ static void SVGExternalSubset(void *context,const xmlChar *name, Static declarations. */ static char - SVGDensityGeometry[] = MagickStringify(SVGDensity) "x" MagickStringify(SVGDensity); + SVGDensityGeometry[] = "90.0x90.0"; static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) { @@ -3334,10 +3328,8 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) (ssize_t *) NULL,&image->columns,&image->rows); if ((image->columns != 0) || (image->rows != 0)) { - image->resolution.x=SVGDensity*image->columns/ - dimension_info.width; - image->resolution.y=SVGDensity*image->rows/ - dimension_info.height; + image->resolution.x=90.0*image->columns/dimension_info.width; + image->resolution.y=90.0*image->rows/dimension_info.height; if (fabs(image->resolution.x) < MagickEpsilon) image->resolution.x=image->resolution.y; else @@ -3351,8 +3343,8 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (apply_density != MagickFalse) { - image->columns=image->resolution.x*dimension_info.width/SVGDensity; - image->rows=image->resolution.y*dimension_info.height/SVGDensity; + image->columns=image->resolution.x*dimension_info.width/90.0; + image->rows=image->resolution.y*dimension_info.height/90.0; } else { @@ -3419,8 +3411,8 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) cairo_paint(cairo_image); cairo_set_operator(cairo_image,CAIRO_OPERATOR_OVER); if (apply_density != MagickFalse) - cairo_scale(cairo_image,image->resolution.x/SVGDensity, - image->resolution.y/SVGDensity); + cairo_scale(cairo_image,image->resolution.x/90.0, + image->resolution.y/90.0); rsvg_handle_render_cairo(svg_handle,cairo_image); cairo_destroy(cairo_image); cairo_surface_destroy(cairo_surface);