From: cristy Date: Wed, 15 Aug 2012 11:36:05 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5130 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7da596eacf5c16ecd650363fe3e0bf81ada3fd8c;p=imagemagick --- diff --git a/MagickCore/image.c b/MagickCore/image.c index 4a359a871..ec5212729 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -200,9 +200,6 @@ MagickExport Image *AcquireImage(const ImageInfo *image_info, exception); (void) QueryColorCompliance(TransparentColor,AllCompliance, &image->transparent_color,exception); - image->resolution.x=DefaultResolution; - image->resolution.y=DefaultResolution; - image->units=PixelsPerInchResolution; GetTimerInfo(&image->timer); image->cache=AcquirePixelCache(0); image->channel_mask=DefaultChannels; diff --git a/coders/svg.c b/coders/svg.c index 487d68ec2..ea2c866c9 100644 --- a/coders/svg.c +++ b/coders/svg.c @@ -184,6 +184,12 @@ typedef struct _SVGInfo #endif } SVGInfo; +/* + Static declarations. +*/ +static char + SVGDensityGeometry[] = "90.0x90.0"; + /* Forward declarations. */ @@ -2787,6 +2793,20 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) image=DestroyImageList(image); return((Image *) NULL); } + if ((image->resolution.x == 0.0) || (image->resolution.y == 0.0)) + { + GeometryInfo + geometry_info; + + int + flags; + + flags=ParseGeometry(SVGDensityGeometry,&geometry_info); + image->resolution.x=geometry_info.rho; + image->resolution.y=geometry_info.sigma; + if ((flags & SigmaValue) == 0) + image->resolution.y=image->resolution.x; + } if (LocaleCompare(image_info->magick,"MSVG") != 0) { const DelegateInfo @@ -2891,9 +2911,8 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) if (svg_handle == (RsvgHandle *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); rsvg_handle_set_base_uri(svg_handle,image_info->filename); - if ((image->resolution.x != 72.0) && (image->resolution.y != 72.0)) - rsvg_handle_set_dpi_x_y(svg_handle,image->resolution.x, - image->resolution.y); + rsvg_handle_set_dpi_x_y(svg_handle,image->resolution.x, + image->resolution.y); while ((n=ReadBlob(image,MaxTextExtent,message)) != 0) { error=(GError *) NULL; diff --git a/coders/wmf.c b/coders/wmf.c index b0644323d..77ca0bd04 100644 --- a/coders/wmf.c +++ b/coders/wmf.c @@ -2692,14 +2692,14 @@ static Image *ReadWMFImage(const ImageInfo *image_info,ExceptionInfo *exception) /* User specified resolution */ resolution_y=DefaultResolution; - if (image->resolution.y > 0) + if (image->resolution.y != 0.0) { resolution_y = image->resolution.y; if (image->units == PixelsPerCentimeterResolution) resolution_y *= CENTIMETERS_PER_INCH; } resolution_x=DefaultResolution; - if (image->resolution.x > 0) + if (image->resolution.x != 0.0) { resolution_x = image->resolution.x; if (image->units == PixelsPerCentimeterResolution)