From dafb4369d18dee03b2b1a150dfc868550e173ec8 Mon Sep 17 00:00:00 2001
From: cristy <cristy@aa41f4f7-0bf4-0310-aa73-e5a19afd5a74>
Date: Mon, 13 Feb 2012 15:51:29 +0000
Subject: [PATCH] git-svn-id:
 https://www.imagemagick.org/subversion/ImageMagick/branches/ImageMagick-6.7.5@6851
 aa41f4f7-0bf4-0310-aa73-e5a19afd5a74

---
 ChangeLog    |    6 ++++++
 coders/pdf.c |    5 +++--
 coders/ps.c  |    5 +++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d0b8894..e37900c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-02-13  6.7.5-6 Cristy  <quetzlzacatenango@image...>
+  * New version 6.7.5-5, SVN revision 6851.
+
+2012-02-13  6.7.5-6 Cristy  <quetzlzacatenango@image...>
+  * Only set PDF & PS page size when explicitedly request (e.g. -page).
+
 2012-02-12  6.7.5-5 Cristy  <quetzlzacatenango@image...>
   * New version 6.7.5-5, SVN revision 6840.
 
diff --git a/coders/pdf.c b/coders/pdf.c
index d128fbc..af8936f 100644
--- a/coders/pdf.c
+++ b/coders/pdf.c
@@ -600,8 +600,9 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception)
   *options='\0';
   (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",image->x_resolution,
     image->y_resolution);
-  (void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
-    page.width,(double) page.height);
+  if (image_info->page != (char *) NULL)
+    (void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
+      page.width,(double) page.height);
   if (cmyk != MagickFalse)
     (void) ConcatenateMagickString(options,"-dUseCIEColor ",MaxTextExtent);
   if (cropbox != MagickFalse)
diff --git a/coders/ps.c b/coders/ps.c
index 60a8050..18aefaf 100644
--- a/coders/ps.c
+++ b/coders/ps.c
@@ -758,8 +758,9 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
   *options='\0';
   (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",
     image->x_resolution,image->y_resolution);
-  (void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
-    page.width,(double) page.height);
+  if (image_info->page != (char *) NULL)
+    (void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
+      page.width,(double) page.height);
   read_info=CloneImageInfo(image_info);
   *read_info->magick='\0';
   if (read_info->number_scenes != 0)
-- 
1.7.9.1

