]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Wed, 5 Oct 2016 16:23:35 +0000 (12:23 -0400)
committerCristy <urban-warrior@imagemagick.org>
Wed, 5 Oct 2016 16:23:35 +0000 (12:23 -0400)
coders/svg.c

index 03e94894b72119a04261c5c209989827681eb741..25ea4201f2900917dd17864bfee5ed91f84d5fda 100644 (file)
@@ -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);