From 24c4902ff7c2d015648563c0717352bbcb27d2d8 Mon Sep 17 00:00:00 2001 From: Cristy Date: Wed, 5 Oct 2016 12:23:35 -0400 Subject: [PATCH] ... --- coders/svg.c | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/coders/svg.c b/coders/svg.c index 03e94894b..25ea4201f 100644 --- a/coders/svg.c +++ b/coders/svg.c @@ -2965,7 +2965,7 @@ 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 != 90.0) && (image->resolution.y != 90.0)) + if ((image->resolution.x > 0.0) && (image->resolution.y > 0.0)) rsvg_handle_set_dpi_x_y(svg_handle,image->resolution.x, image->resolution.y); while ((n=ReadBlob(image,MagickPathExtent-1,message)) != 0) @@ -2981,29 +2981,12 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) if (error != (GError *) NULL) g_error_free(error); #if defined(MAGICKCORE_CAIRO_DELEGATE) - if (image_info->size != (char *) NULL) + if ((image->columns == 0) || image->rows == 0)) { - (void) GetGeometry(image_info->size,(ssize_t *) NULL, - (ssize_t *) NULL,&image->columns,&image->rows); - if ((image->columns != 0) || (image->rows != 0)) - { - rsvg_handle_get_dimensions(svg_handle,&dimension_info); - if (dimension_info.width != 0) - image->resolution.x=90.0*image->columns/dimension_info.width; - if (dimension_info.height != 0) - image->resolution.y=90.0*image->rows/dimension_info.height; - if (image->resolution.x == 0) - image->resolution.x=image->resolution.y; - else if (image->resolution.y == 0) - image->resolution.y=image->resolution.x; - else - image->resolution.x=image->resolution.y=MagickMin( - image->resolution.x,image->resolution.y); - } + rsvg_handle_get_dimensions(svg_handle,&dimension_info); + image->columns=dimension_info.width; + image->rows=dimension_info.height; } - rsvg_handle_get_dimensions(svg_handle,&dimension_info); - image->columns=dimension_info.width; - image->rows=dimension_info.height; pixel_info=(MemoryInfo *) NULL; #else pixel_buffer=rsvg_handle_get_pixbuf(svg_handle); -- 2.40.0