/*
- * "$Id: imagetoraster.c 5522 2006-05-15 05:02:15Z mike $"
+ * "$Id: imagetoraster.c 7306 2008-02-15 00:52:38Z mike $"
*
* Image file to raster filter for the Common UNIX Printing System (CUPS).
*
- * Copyright 1993-2006 by Easy Software Products.
+ * Copyright 2007 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.
*
#include "common.h"
#include "image-private.h"
-#include "raster.h"
#include <unistd.h>
#include <math.h>
+#include <cups/i18n.h>
/*
if (argc < 6 || argc > 7)
{
- fputs("ERROR: imagetoraster job-id user title copies options [file]\n", stderr);
+ fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
+ argv[0]);
return (1);
}
- fprintf(stderr, "INFO: %s %s %s %s %s %s %s\n", argv[0], argv[1], argv[2],
- argv[3], argv[4], argv[5], argv[6] ? argv[6] : "(null)");
-
/*
* See if we need to use the imagetops and pstoraster filters instead...
*/
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 (cupsRasterInterpretPPD(&header, ppd, num_options, options, raster_cb))
{
- fputs("ERROR: Bad page setup!\n", stderr);
+ fputs(_("ERROR: Bad page setup!\n"), stderr);
+ fprintf(stderr, "DEBUG: %s\n", cupsRasterErrorString());
return (1);
}
* Open the input image to print...
*/
- fputs("INFO: Loading image file...\n", stderr);
+ fputs(_("INFO: Loading image file...\n"), stderr);
if (header.cupsColorSpace == CUPS_CSPACE_CIEXYZ ||
header.cupsColorSpace == CUPS_CSPACE_CIELab ||
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);
}
for (xpage = 0; xpage < xpages; xpage ++)
for (ypage = 0; ypage < ypages; ypage ++, page ++)
{
- fprintf(stderr, "INFO: Formatting page %d...\n", page);
+ fprintf(stderr, _("INFO: Formatting page %d...\n"), page);
if (Orientation & 1)
{
if (cupsRasterWritePixels(ras, row, header.cupsBytesPerLine) <
header.cupsBytesPerLine)
{
- fputs("ERROR: Unable to write raster data to driver!\n", stderr);
+ fputs(_("ERROR: Unable to write raster data to driver!\n"),
+ stderr);
cupsImageClose(img);
exit(1);
}
if (cupsRasterWritePixels(ras, row, header.cupsBytesPerLine) <
header.cupsBytesPerLine)
{
- fputs("ERROR: Unable to write raster data to driver!\n", stderr);
+ fputs(_("ERROR: Unable to write raster data to driver!\n"),
+ stderr);
cupsImageClose(img);
exit(1);
}
if (cupsRasterWritePixels(ras, row, header.cupsBytesPerLine) <
header.cupsBytesPerLine)
{
- fputs("ERROR: Unable to write raster data to driver!\n", stderr);
+ fputs(_("ERROR: Unable to write raster data to driver!\n"),
+ stderr);
cupsImageClose(img);
exit(1);
}
/*
- * End of "$Id: imagetoraster.c 5522 2006-05-15 05:02:15Z mike $".
+ * End of "$Id: imagetoraster.c 7306 2008-02-15 00:52:38Z mike $".
*/