]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror ESP Ghostscript update.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 27 Aug 2003 18:12:48 +0000 (18:12 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 27 Aug 2003 18:12:48 +0000 (18:12 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3885 7a7537e8-13f0-0310-91df-b6672ffda945

pstoraster/gdevcups.c

index c145023513c84630e337eb9f263b24b3d9917afe..7a53515ed5cbc87981ebd3f2b5cf8ceb4913e612 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: gdevcups.c,v 1.43.2.20 2003/08/26 21:15:48 mike Exp $"
+ * "$Id: gdevcups.c,v 1.43.2.21 2003/08/27 18:12:48 mike Exp $"
  *
  *   GNU Ghostscript raster output driver for the Common UNIX Printing
  *   System (CUPS).
@@ -2243,13 +2243,36 @@ cups_put_params(gx_device     *pdev,    /* I - Device info */
                pdev->HWResolution[1] / 72.0f + 0.499f;
     }
 
-    fprintf(stderr, "DEBUG: Reallocating memory, [%.0f %.0f] = %dx%d pixels...\n",
-            pdev->MediaSize[0], pdev->MediaSize[1], width, height);
+   /*
+    * Don't reallocate memory unless the device has been opened...
+    */
+
+    if (pdev->is_open)
+    {
+     /*
+      * Device is open, so reallocate...
+      */
 
-    sp = ((gx_device_printer *)pdev)->space_params;
+      fprintf(stderr, "DEBUG: Reallocating memory, [%.0f %.0f] = %dx%d pixels...\n",
+              pdev->MediaSize[0], pdev->MediaSize[1], width, height);
 
-    if ((code = gdev_prn_reallocate_memory(pdev, &sp, width, height)) < 0)
-      return (code);
+      sp = ((gx_device_printer *)pdev)->space_params;
+
+      if ((code = gdev_prn_reallocate_memory(pdev, &sp, width, height)) < 0)
+       return (code);
+    }
+    else
+    {
+     /*
+      * Device isn't yet open, so just save the new width and height...
+      */
+
+      fprintf(stderr, "DEBUG: Setting initial media size, [%.0f %.0f] = %dx%d pixels...\n",
+              pdev->MediaSize[0], pdev->MediaSize[1], width, height);
+
+      pdev->width  = width;
+      pdev->height = height;
+    }
   }
 
 #ifdef DEBUG
@@ -3649,5 +3672,5 @@ cups_print_planar(gx_device_printer *pdev,        /* I - Printer device */
 
 
 /*
- * End of "$Id: gdevcups.c,v 1.43.2.20 2003/08/26 21:15:48 mike Exp $".
+ * End of "$Id: gdevcups.c,v 1.43.2.21 2003/08/27 18:12:48 mike Exp $".
  */