]> granicus.if.org Git - imagemagick/commitdiff
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=30591
authorCristy <urban-warrior@imagemagick.org>
Tue, 4 Oct 2016 16:16:03 +0000 (12:16 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 4 Oct 2016 16:16:03 +0000 (12:16 -0400)
coders/svg.c

index 16b37eea68f3eb067de036392f191e839708b8df..4da94931f56c57c8eab900b8534c638f378505f2 100644 (file)
@@ -2981,13 +2981,13 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
         if (error != (GError *) NULL)
           g_error_free(error);
 #if defined(MAGICKCORE_CAIRO_DELEGATE)
-        rsvg_handle_get_dimensions(svg_handle,&dimension_info);
         if (image_info->size != (char *) NULL)
           {
             (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);
                 image->resolution.x=90.0*image->columns/dimension_info.width;
                 image->resolution.y=90.0*image->rows/dimension_info.height;
                 if (image->resolution.x == 0)
@@ -2999,8 +2999,9 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
                     image->resolution.x,image->resolution.y);
               }
           }
-        image->columns=image->resolution.x*dimension_info.width/90.0;
-        image->rows=image->resolution.y*dimension_info.height/90.0;
+        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);