File gimp-print-4.2.7-pcl.dif of Package ghostscript-library.openSUSE_11.4_Update

--- gimp-print-4.2.7/src/main/print-pcl.c
+++ gimp-print-4.2.7/src/main/print-pcl.c	2005-03-16 17:06:53.000000000 +0100
@@ -339,13 +339,14 @@ static const pcl_cap_t pcl_model_capabil
   /* DesignJet 230/430 (monochrome ) */
   { 10230,
     36 * 72, 150 * 12 * 72,		/* 150ft in roll mode, 64" in sheet */
-    830 * 72 / 100, 583 * 72 / 100,	/* 8.3" wide min in sheet mode */
+    826 * 72 / 100, 583 * 72 / 100,	/* 8.3" wide min in sheet mode */
     PCL_RES_300_300 | PCL_RES_600_600,
     {49, 49, 15, 15},
     {49, 49, 15, 15},
     PCL_COLOR_NONE,
     PCL_PRINTER_DJ | PCL_PRINTER_TIFF | PCL_PRINTER_BLANKLINE | PCL_PRINTER_CUSTOM_SIZE | PCL_PRINTER_NEW_ERG,
     {
+      PCL_PAPERSIZE_A4,
       PCL_PAPERSIZE_LETTER,
       -1,
     },
@@ -366,13 +367,14 @@ static const pcl_cap_t pcl_model_capabil
   /* The "CA" versions have a "software RIP" but are the same hardware */
   { 10250,
     36 * 72, 150 * 12 * 72,		/* 150ft in roll mode, 64" in sheet */
-    830 * 72 / 100, 583 * 72 / 100,	/* 8.3" wide min in sheet mode */
+    826 * 72 / 100, 583 * 72 / 100,	/* 8.3" wide min in sheet mode */
     PCL_RES_300_300 | PCL_RES_600_600_MONO,
     {49, 49, 15, 15},
     {49, 49, 15, 15},
     PCL_COLOR_CMYK,
     PCL_PRINTER_DJ | PCL_PRINTER_TIFF | PCL_PRINTER_BLANKLINE | PCL_PRINTER_CUSTOM_SIZE | PCL_PRINTER_NEW_ERG,
     {
+      PCL_PAPERSIZE_A4,
       PCL_PAPERSIZE_LETTER,
       -1,
     },
@@ -392,13 +394,14 @@ static const pcl_cap_t pcl_model_capabil
   /* DesignJet 700 (monochrome) */
   { 10700,
     36 * 72, 150 * 12 * 72,		/* 150ft in roll mode, 64" in sheet */
-    830 * 72 / 100, 583 * 72 / 100,	/* 8.3" wide min in sheet mode */
+    826 * 72 / 100, 583 * 72 / 100,	/* 8.3" wide min in sheet mode */
     PCL_RES_300_300 | PCL_RES_600_600,
     {30, 30, 15, 15},		/* These margins are for sheet mode FIX */
     {30, 30, 15, 15},
     PCL_COLOR_NONE,
     PCL_PRINTER_DJ | PCL_PRINTER_TIFF | PCL_PRINTER_BLANKLINE | PCL_PRINTER_CUSTOM_SIZE | PCL_PRINTER_NEW_ERG,
     {
+      PCL_PAPERSIZE_A4,
       PCL_PAPERSIZE_LETTER,
       -1,
     },
@@ -418,13 +421,14 @@ static const pcl_cap_t pcl_model_capabil
   /* DesignJet 750C */
   { 10750,
     36 * 72, 150 * 12 * 72,		/* 150ft in roll mode, 64" in sheet */
-    830 * 72 / 100, 583 * 72 / 100,	/* 8.3" wide min in sheet mode */
+    826 * 72 / 100, 583 * 72 / 100,	/* 8.3" wide min in sheet mode */
     PCL_RES_300_300 | PCL_RES_600_600_MONO,
     {30, 30, 15, 15},	/* These margins are for roll mode FIX */
     {30, 30, 15, 15},
     PCL_COLOR_CMYK,
     PCL_PRINTER_DJ | PCL_PRINTER_TIFF | PCL_PRINTER_BLANKLINE | PCL_PRINTER_CUSTOM_SIZE | PCL_PRINTER_NEW_ERG,
     {
+      PCL_PAPERSIZE_A4,
       PCL_PAPERSIZE_LETTER,
       -1,
     },
@@ -444,13 +448,14 @@ static const pcl_cap_t pcl_model_capabil
   /* DesignJet 2000C/2500C (36" wide) */
   { 12500,	/* Deskjet 2500 already has "2500" */
     36 * 72, 150 * 12 * 72,		/* 150ft in roll mode, 64" in sheet */
-    830 * 72 / 100, 583 * 72 / 100,	/* 8.3" wide min in sheet mode */
+    826 * 72 / 100, 583 * 72 / 100,	/* 8.3" wide min in sheet mode */
     PCL_RES_300_300 | PCL_RES_600_600_MONO,
     {49, 49, 15, 15},		/* Check/Fix */
     {49, 49, 15, 15},
     PCL_COLOR_CMYK,
     PCL_PRINTER_DJ | PCL_PRINTER_TIFF | PCL_PRINTER_BLANKLINE | PCL_PRINTER_CUSTOM_SIZE | PCL_PRINTER_NEW_ERG,
     {
+      PCL_PAPERSIZE_A4,
       PCL_PAPERSIZE_LETTER,
       -1,
     },
@@ -470,13 +475,14 @@ static const pcl_cap_t pcl_model_capabil
   /* DesignJet 3000C/3500C (54" wide) */
   { 13500,	/* Deskjet 2500 already has "2500" */
     54 * 72, 150 * 12 * 72,		/* 150ft in roll mode, 64" in sheet */
-    830 * 72 / 100, 583 * 72 / 100,	/* 8.3" wide min in sheet mode */
+    826 * 72 / 100, 583 * 72 / 100,	/* 8.3" wide min in sheet mode */
     PCL_RES_300_300 | PCL_RES_600_600_MONO,
     {49, 49, 15, 15},		/* Check/Fix */
     {49, 49, 15, 15},
     PCL_COLOR_CMYK,
     PCL_PRINTER_DJ | PCL_PRINTER_TIFF | PCL_PRINTER_BLANKLINE | PCL_PRINTER_CUSTOM_SIZE | PCL_PRINTER_NEW_ERG,
     {
+      PCL_PAPERSIZE_A4,
       PCL_PAPERSIZE_LETTER,
       -1,
     },
@@ -1872,7 +1878,7 @@ pcl_parameters(const stp_printer_t print
   if (strcmp(name, "PageSize") == 0)
     {
       int papersizes = stp_known_papersizes();
-      valptrs = stp_malloc(sizeof(stp_param_t) * papersizes);
+      valptrs = stp_zalloc(sizeof(stp_param_t) * papersizes);
       *count = 0;
       for (i = 0; i < papersizes; i++)
 	{
@@ -1898,7 +1904,7 @@ pcl_parameters(const stp_printer_t print
     }
     else
     {
-      valptrs = stp_malloc(sizeof(stp_param_t) * NUM_PRINTER_PAPER_TYPES);
+      valptrs = stp_zalloc(sizeof(stp_param_t) * NUM_PRINTER_PAPER_TYPES);
       *count = 0;
       for (i=0; (i < NUM_PRINTER_PAPER_TYPES) && (caps->paper_types[i] != -1); i++)
       {
@@ -1922,7 +1928,7 @@ pcl_parameters(const stp_printer_t print
     }
     else
     {
-      valptrs = stp_malloc(sizeof(stp_param_t) * NUM_PRINTER_PAPER_SOURCES);
+      valptrs = stp_zalloc(sizeof(stp_param_t) * NUM_PRINTER_PAPER_SOURCES);
       *count = 0;
       for (i=0; (i < NUM_PRINTER_PAPER_SOURCES) && (caps->paper_sources[i] != -1); i++)
       {
@@ -1940,7 +1946,7 @@ pcl_parameters(const stp_printer_t print
   else if (strcmp(name, "Resolution") == 0)
   {
     *count = 0;
-    valptrs = stp_malloc(sizeof(stp_param_t) * NUM_RESOLUTIONS);
+    valptrs = stp_zalloc(sizeof(stp_param_t) * NUM_RESOLUTIONS);
     for (i = 0; i < NUM_RESOLUTIONS; i++)
     {
       if (caps->resolutions & pcl_resolutions[i].pcl_code)
@@ -1958,7 +1964,7 @@ pcl_parameters(const stp_printer_t print
   {
     if (caps->color_type & PCL_COLOR_CMYKcm)
     {
-      valptrs = stp_malloc(sizeof(stp_param_t) * 2);
+      valptrs = stp_zalloc(sizeof(stp_param_t) * 2);
       valptrs[0].name = c_strdup(ink_types[0].name);
       valptrs[0].text = c_strdup(_(ink_types[0].text));
       valptrs[1].name = c_strdup(ink_types[1].name);
@@ -2274,13 +2280,13 @@ pcl_print(const stp_printer_t printer,
     {
       stp_eprintf(v, "600x600 resolution only available in MONO\n");
       output_type = OUTPUT_GRAY;
-      stp_set_output_type(nv, OUTPUT_GRAY);
+      stp_set_output_type(nv, output_type);
     }
 
   if (caps->color_type == PCL_COLOR_NONE && output_type != OUTPUT_MONOCHROME)
     {
       output_type = OUTPUT_GRAY;
-      stp_set_output_type(nv, OUTPUT_GRAY);
+      stp_set_output_type(nv, output_type);
     }
   stp_set_output_color_model(nv, COLOR_MODEL_CMY);
 
@@ -2484,15 +2490,16 @@ pcl_print(const stp_printer_t printer,
     * vertical resolutions as well as a color count...
     */
 
-    if (output_type != OUTPUT_GRAY && output_type != OUTPUT_MONOCHROME)
-      if ((caps->color_type & PCL_COLOR_CMY) == PCL_COLOR_CMY)
+    if (output_type != OUTPUT_GRAY && output_type != OUTPUT_MONOCHROME) {
+      if ((caps->color_type & PCL_COLOR_CMY) == PCL_COLOR_CMY) {
         planes = 3;
-      else
+      } else {
         if (do_6color)
           planes = 6;
         else
           planes = 4;
-    else
+      }
+    } else
       planes = 1;
 
     stp_zprintf(v, "\033*g%dW", 2 + (planes * 6));
@@ -2621,7 +2628,7 @@ pcl_print(const stp_printer_t printer,
 
   if (output_type == OUTPUT_GRAY || output_type == OUTPUT_MONOCHROME)
   {
-    black   = stp_malloc(height);
+    black   = stp_zalloc(height);
     cyan    = NULL;
     magenta = NULL;
     yellow  = NULL;
@@ -2630,18 +2637,18 @@ pcl_print(const stp_printer_t printer,
   }
   else
   {
-    cyan    = stp_malloc(height);
-    magenta = stp_malloc(height);
-    yellow  = stp_malloc(height);
+    cyan    = stp_zalloc(height);
+    magenta = stp_zalloc(height);
+    yellow  = stp_zalloc(height);
 
     if ((caps->color_type & PCL_COLOR_CMY) == PCL_COLOR_CMY)
       black = NULL;
     else
-      black = stp_malloc(height);
+      black = stp_zalloc(height);
     if (do_6color)
     {
-      lcyan    = stp_malloc(height);
-      lmagenta = stp_malloc(height);
+      lcyan    = stp_zalloc(height);
+      lmagenta = stp_zalloc(height);
     }
     else
     {
@@ -2784,13 +2791,23 @@ pcl_print(const stp_printer_t printer,
     }
 
     stp_dither(out, y, dither, dt, duplicate_line, zero_mask);
-
+#if 0
     len_c = stp_dither_get_last_position(dither, ECOLOR_C, 0);
     len_lc = stp_dither_get_last_position(dither, ECOLOR_C, 1);
     len_m = stp_dither_get_last_position(dither, ECOLOR_M, 0);
     len_lm = stp_dither_get_last_position(dither, ECOLOR_M, 1);
     len_y = stp_dither_get_last_position(dither, ECOLOR_Y, 0);
     len_k = stp_dither_get_last_position(dither, ECOLOR_K, 0);
+#else
+#   define empty_line(c)	((!c) ? -1 : (((!c[0]&&!memcmp(c,c+1,height-1))) ? -1 : 0))
+    len_c  = empty_line(cyan);
+    len_lc = empty_line(lcyan);
+    len_m  = empty_line(magenta);
+    len_lm = empty_line(lmagenta);
+    len_y  = empty_line(yellow);
+    len_k  = empty_line(black);
+#   undef empty_line
+#endif
 
 /*
  * Blank line removal. If multiple lines are blank then they can be replaced
openSUSE Build Service is sponsored by