]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - filter/imagetoraster.c
Merge changes from CUPS 1.5svn-r9385.
[thirdparty/cups.git] / filter / imagetoraster.c
index a54080c2d1825b7060a1dffce63478a64af4a4ea..45a2dbdae6c02bcec97d6cb34f56d62f2873463b 100644 (file)
@@ -204,8 +204,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
   if (argc < 6 || argc > 7)
   {
-    fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
-            argv[0]);
+    _cupsLangPrintf(stderr,
+                    _("Usage: %s job-id user title copies options file"),
+                    argv[0]);
     return (1);
   }
 
@@ -231,7 +232,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
     if (pipe(mypipes))
     {
-      perror("ERROR: Unable to create pipes for imagetops | pstoraster");
+      _cupsLangPrintError("ERROR", _("Unable to create pipes for filters"));
       return (errno);
     }
 
@@ -247,7 +248,6 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
       execlp("pstoraster", argv[0], argv[1], argv[2], argv[3], argv[4], argv[5],
              NULL);
-      perror("ERROR: Unable to exec pstoraster");
       return (errno);
     }
     else if (pid < 0)
@@ -256,7 +256,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
       * Error!
       */
 
-      perror("ERROR: Unable to fork pstoraster");
+      _cupsLangPrintError("ERROR", _("Unable to fork filter"));
       return (errno);
     }
 
@@ -269,13 +269,12 @@ main(int  argc,                           /* I - Number of command-line arguments */
     close(mypipes[1]);
 
    /*
-    * Run imagetops to get the classification or page labelling that was
+    * Run imagetops to get the classification or page labeling that was
     * requested...
     */
 
     execlp("imagetops", argv[0], argv[1], argv[2], argv[3], argv[4], argv[5],
            argv[6], NULL);
-    perror("ERROR: Unable to exec imagetops");
     return (errno);
   }
 
@@ -292,11 +291,12 @@ main(int  argc,                           /* I - Number of command-line arguments */
 
     if ((fd = cupsTempFd(filename, sizeof(filename))) < 0)
     {
-      perror("ERROR: Unable to copy image file");
+      _cupsLangPrintError("ERROR", _("Unable to copy print file"));
       return (1);
     }
 
-    fprintf(stderr, "DEBUG: imagetoraster - copying to temp print file \"%s\"\n",
+    fprintf(stderr,
+            "DEBUG: imagetoraster - copying to temp print file \"%s\".\n",
             filename);
 
     while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
@@ -455,7 +455,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
   if (cupsRasterInterpretPPD(&header, ppd, num_options, options, raster_cb))
   {
-    _cupsLangPuts(stderr, _("ERROR: The page setup information was not valid.\n"));
+    _cupsLangPrintFilter(stderr, "ERROR",
+                         _("The page setup information was not valid."));
     fprintf(stderr, "DEBUG: %s\n", cupsRasterErrorString());
     return (1);
   }
@@ -575,7 +576,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
     case CUPS_CSPACE_DEVICED :
     case CUPS_CSPACE_DEVICEE :
     case CUPS_CSPACE_DEVICEF :
-        fprintf(stderr, "ERROR: Colorspace %d not supported.\n",
+        fprintf(stderr, "DEBUG: Colorspace %d not supported.\n",
                header.cupsColorSpace);
        exit(1);
        break;
@@ -656,7 +657,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
   * Open the input image to print...
   */
 
-  _cupsLangPuts(stderr, _("INFO: Loading image file...\n"));
+  _cupsLangPrintFilter(stderr, "INFO", _("Loading print file."));
 
   if (header.cupsColorSpace == CUPS_CSPACE_CIEXYZ ||
       header.cupsColorSpace == CUPS_CSPACE_CIELab ||
@@ -670,7 +671,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
   if (img == NULL)
   {
-    _cupsLangPuts(stderr, _("ERROR: The image file to print could not be opened.\n"));
+    _cupsLangPrintFilter(stderr, "ERROR",
+                         _("The print file could not be opened."));
     ppdClose(ppd);
     return (1);
   }
@@ -1175,7 +1177,7 @@ main(int  argc,                           /* I - Number of command-line arguments */
     for (xpage = 0; xpage < xpages; xpage ++)
       for (ypage = 0; ypage < ypages; ypage ++, page ++)
       {
-        fprintf(stderr, _("INFO: Formatting page %d...\n"), page);
+        _cupsLangPrintFilter(stderr, "INFO", _("Formatting page %d."), page);
 
        if (Orientation & 1)
        {
@@ -1232,9 +1234,9 @@ main(int  argc,                           /* I - Number of command-line arguments */
              if (cupsRasterWritePixels(ras, row, header.cupsBytesPerLine) <
                      header.cupsBytesPerLine)
              {
-               _cupsLangPuts(stderr,
-                             _("ERROR: The raster data could not be written "
-                               "to the driver.\n"));
+               _cupsLangPrintFilter(stderr, "ERROR",
+                                    _("Unable to send raster data to the "
+                                      "driver."));
                cupsImageClose(img);
                exit(1);
              }
@@ -1329,9 +1331,9 @@ main(int  argc,                           /* I - Number of command-line arguments */
            if (cupsRasterWritePixels(ras, row, header.cupsBytesPerLine) <
                                      header.cupsBytesPerLine)
            {
-             _cupsLangPuts(stderr,
-                           _("ERROR: The raster data could not be written to "
-                             "the driver.\n"));
+             _cupsLangPrintFilter(stderr, "ERROR",
+                                  _("Unable to send raster data to the "
+                                    "driver."));
              cupsImageClose(img);
              exit(1);
            }
@@ -1370,9 +1372,9 @@ main(int  argc,                           /* I - Number of command-line arguments */
              if (cupsRasterWritePixels(ras, row, header.cupsBytesPerLine) <
                      header.cupsBytesPerLine)
              {
-               _cupsLangPuts(stderr,
-                             _("ERROR: The raster data could not be written "
-                               "to the driver.\n"));
+               _cupsLangPrintFilter(stderr, "ERROR",
+                                    _("Unable to send raster data to the "
+                                      "driver."));
                cupsImageClose(img);
                exit(1);
              }