]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - filter/rastertopwg.c
Fix source file header text duplication text duplication.
[thirdparty/cups.git] / filter / rastertopwg.c
index 66c1512c72d21373ddfadb437d0f6589e4a9f5df..5026f565432f8aab306168c5e639fb2cb1d546ce 100644 (file)
@@ -7,7 +7,7 @@
  * 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/".
+ * missing or damaged, see the license at "http://www.cups.org/".
  *
  * This file is subject to the Apple OS-Developed Software exception.
  */
@@ -31,6 +31,8 @@ int                                   /* O - Exit status */
 main(int  argc,                                /* I - Number of command-line args */
      char *argv[])                     /* I - Command-line arguments */
 {
+  const char           *final_content_type;
+                                       /* FINAL_CONTENT_TYPE env var */
   int                  fd;             /* Raster file */
   cups_raster_t                *inras,         /* Input raster stream */
                        *outras;        /* Output raster stream */
@@ -73,8 +75,11 @@ main(int  argc,                              /* I - Number of command-line args */
   else
     fd = 0;
 
+  if ((final_content_type = getenv("FINAL_CONTENT_TYPE")) == NULL)
+    final_content_type = "image/pwg-raster";
+
   inras  = cupsRasterOpen(fd, CUPS_RASTER_READ);
-  outras = cupsRasterOpen(1, CUPS_RASTER_WRITE_PWG);
+  outras = cupsRasterOpen(1, !strcmp(final_content_type, "image/pwg-raster") ? CUPS_RASTER_WRITE_PWG : CUPS_RASTER_WRITE_APPLE);
 
   ppd   = ppdOpenFile(getenv("PPD"));
   back  = ppdFindAttr(ppd, "cupsBackSide", NULL);