]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - filter/imagetops.c
Merge changes from CUPS 1.5svn-r8849.
[thirdparty/cups.git] / filter / imagetops.c
index 55a19f260fcf88b5649e290f2b82dbcd0ac076e0..b61eb7722c7011ab2fab7237f494d6ff849fd26f 100644 (file)
@@ -1,25 +1,16 @@
 /*
- * "$Id: imagetops.c 6420 2007-03-30 20:00:59Z mike $"
+ * "$Id: imagetops.c 6649 2007-07-11 21:46:42Z mike $"
  *
  *   Image file to PostScript filter for the Common UNIX Printing System (CUPS).
  *
+ *   Copyright 2007-2009 by Apple Inc.
  *   Copyright 1993-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
- *   property of Easy Software Products and are protected by Federal
- *   copyright law.  Distribution and use rights are outlined in the file
- *   "LICENSE.txt" which should have been included with this file.  If this
- *   file is missing or damaged please contact Easy Software Products
- *   at:
- *
- *       Attn: CUPS Licensing Information
- *       Easy Software Products
- *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636 USA
- *
- *       Voice: (301) 373-9600
- *       EMail: cups-info@cups.org
- *         WWW: http://www.cups.org
+ *   property of Apple Inc. and are protected by Federal copyright
+ *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ *   which should have been included with this file.  If this file is
+ *   file is missing or damaged, see the license at "http://www.cups.org/".
  *
  *   This file is subject to the Apple OS-Developed Software exception.
  *
@@ -221,7 +212,11 @@ main(int  argc,                            /* I - Number of command-line arguments */
 
   if ((val = cupsGetOption("scaling", num_options, options)) != NULL)
     zoom = atoi(val) * 0.01;
-  else if (cupsGetOption("fitplot", num_options, options))
+  else if ((val = cupsGetOption("fitplot", num_options, options)) != NULL &&
+           !strcasecmp(val, "true"))
+    zoom = 1.0;
+  else if ((val = cupsGetOption("fit-to-page", num_options, options)) != NULL &&
+           !strcasecmp(val, "true"))
     zoom = 1.0;
 
   if ((val = cupsGetOption("ppi", num_options, options)) != NULL)
@@ -283,8 +278,16 @@ main(int  argc,                            /* I - Number of command-line arguments */
   if ((val = cupsGetOption("hue", num_options, options)) != NULL)
     hue = atoi(val);
 
-  if ((val = cupsGetOption("mirror", num_options, options)) != NULL &&
-      strcasecmp(val, "True") == 0)
+  if ((choice = ppdFindMarkedChoice(ppd, "MirrorPrint")) != NULL)
+  {
+    val = choice->choice;
+    choice->marked = 0;
+  }
+  else
+    val = cupsGetOption("mirror", num_options, options);
+
+  if (val && (!strcasecmp(val, "true") || !strcasecmp(val, "on") ||
+              !strcasecmp(val, "yes")))
     Flip = 1;
 
   if ((val = cupsGetOption("emit-jcl", num_options, options)) != NULL &&
@@ -307,7 +310,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
   if (img == NULL)
   {
-    fputs(_("ERROR: Unable to open image file for printing!\n"), stderr);
+    fputs(_("ERROR: Unable to open image file for printing\n"), stderr);
     ppdClose(ppd);
     return (1);
   }
@@ -1062,5 +1065,5 @@ ps_ascii85(cups_ib_t *data,               /* I - Data to print */
 
 
 /*
- * End of "$Id: imagetops.c 6420 2007-03-30 20:00:59Z mike $".
+ * End of "$Id: imagetops.c 6649 2007-07-11 21:46:42Z mike $".
  */