]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 25 Mar 2010 18:31:50 +0000 (18:31 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 25 Mar 2010 18:31:50 +0000 (18:31 +0000)
ChangeLog
coders/pdf.c
coders/ps.c

index 6ced81a926d763e3f22a2b131b7cb97a0ccc7d6b..50ea5c57df359b030c1ab27f61b24189e110f1a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2010-03-21  6.6.0-9 Cristy  <quetzlzacatenango@image...>
+  * Respect the -density option when rendering a Postscript or PDF image.
+
 2010-03-24  6.6.0-9 Glenn Randers-Pehrson <glennrp@image...>
   * coders/png.c: Eliminated support of libpng versions older than 1.0.12.
   * Relocated the new, misplaced png_get_rowbytes() call.
index e7ad0d0aa2c76f448dfe1b968eb9f9397e4d04a3..8514bf40f1a87fbf91724d793eb81fde7b2a9c18 100644 (file)
@@ -316,6 +316,9 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
   double
     angle;
 
+  GeometryInfo
+    geometry_info;
+
   Image
     *image,
     *next,
@@ -333,6 +336,9 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
     trimbox,
     status;
 
+  MagickStatusType
+    flags;
+
   PointInfo
     delta;
 
@@ -389,12 +395,6 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
   delta.y=DefaultResolution;
   if ((image->x_resolution == 0.0) || (image->y_resolution == 0.0))
     {
-      GeometryInfo
-        geometry_info;
-
-      MagickStatusType
-        flags;
-
       flags=ParseGeometry(PSDensityGeometry,&geometry_info);
       image->x_resolution=geometry_info.rho;
       image->y_resolution=geometry_info.sigma;
@@ -582,6 +582,14 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
       return((Image *) NULL);
     }
   *options='\0';
+  if (image_info->density != (char *) NULL)
+    {
+      flags=ParseGeometry(image_info->density,&geometry_info);
+      image->x_resolution=geometry_info.rho;
+      image->y_resolution=geometry_info.sigma;
+      if ((flags & SigmaValue) == 0)
+        image->y_resolution=image->x_resolution;
+    }
   (void) FormatMagickString(density,MaxTextExtent,"%gx%g",
     image->x_resolution,image->y_resolution);
   if (image_info->page != (char *) NULL)
index d204f5b389ef48be0b140a267ffad4ca141909ce..c2f02ccfbb0becd8547fadd513f0c0db640419cb 100644 (file)
@@ -718,10 +718,18 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
   *options='\0';
   if ((page.width == 0) || (page.height == 0))
     (void) ParseAbsoluteGeometry(PSPageGeometry,&page);
-  if (image_info->page != (char *) NULL)
-    (void) ParseAbsoluteGeometry(image_info->page,&page);
+  if (image_info->density != (char *) NULL)
+    {
+      flags=ParseGeometry(image_info->density,&geometry_info);
+      image->x_resolution=geometry_info.rho;
+      image->y_resolution=geometry_info.sigma;
+      if ((flags & SigmaValue) == 0)
+        image->y_resolution=image->x_resolution;
+    }
   (void) FormatMagickString(density,MaxTextExtent,"%gx%g",
     image->x_resolution,image->y_resolution);
+  if (image_info->page != (char *) NULL)
+    (void) ParseAbsoluteGeometry(image_info->page,&page);
   page.width=(unsigned long) floor(page.width*image->x_resolution/delta.x+0.5);
   page.height=(unsigned long) floor(page.height*image->y_resolution/delta.y+
     0.5);