]> granicus.if.org Git - imagemagick/commitdiff
Dpi fix.
authordirk <dirk@git.imagemagick.org>
Thu, 2 Jan 2014 08:14:54 +0000 (08:14 +0000)
committerdirk <dirk@git.imagemagick.org>
Thu, 2 Jan 2014 08:14:54 +0000 (08:14 +0000)
coders/svg.c

index a0828168ce562c85b1cca09f1bea9c91958975e5..6cf62e0a04d622ea3474f25f1e0aff547ef85dfb 100644 (file)
@@ -2918,8 +2918,9 @@ 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);
-        rsvg_handle_set_dpi_x_y(svg_handle,image->resolution.x,
-          image->resolution.y);
+        if ((image->resolution.x != 90.0) && (image->resolution.y != 90.0))
+          rsvg_handle_set_dpi_x_y(svg_handle,image->resolution.x,
+            image->resolution.y);
         while ((n=ReadBlob(image,MaxTextExtent,message)) != 0)
         {
           error=(GError *) NULL;
@@ -2933,8 +2934,8 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
           g_error_free(error);
 #if defined(MAGICKCORE_CAIRO_DELEGATE)
         rsvg_handle_get_dimensions(svg_handle,&dimension_info);
-        image->columns=image->resolution.x*dimension_info.width/72.0;
-        image->rows=image->resolution.y*dimension_info.height/72.0;
+        image->columns=image->resolution.x*dimension_info.width/90.0;
+        image->rows=image->resolution.y*dimension_info.height/90.0;
         pixel_info=(MemoryInfo *) NULL;
 #else
         pixel_buffer=rsvg_handle_get_pixbuf(svg_handle);