[Pkg-cups-devel] r231 - in cupsys/branches/cups-1.2-ubuntu/debian:
patches
Martin Pitt
mpitt at costa.debian.org
Tue May 16 10:51:00 UTC 2006
Author: mpitt
Date: Tue May 16 10:50:58 2006
New Revision: 231
Added:
cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5512_KCMYcm_fix.dpatch (contents, props changed)
cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5518_12bitraster.dpatch (contents, props changed)
cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5523_1_2_4bit_raster.dpatch (contents, props changed)
cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5526_str1676_stopped_jobs_active.dpatch (contents, props changed)
cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5527_LDAP_define.dpatch (contents, props changed)
cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5527_str1683_lpstaterror.dpatch (contents, props changed)
cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5527_str1689_printeroptions.dpatch (contents, props changed)
cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5528_str1680_load_custom_options.dpatch (contents, props changed)
Modified:
cupsys/branches/cups-1.2-ubuntu/debian/changelog
cupsys/branches/cups-1.2-ubuntu/debian/patches/00list
Log:
* Pull some bug fixes from SVN head:
* Add debian/patches/svn5512_KCMYcm_fix.dpatch: Fix bug in KCMYcm handling
(typo in variable name).
* Add debian/patches/svn5518_12bitraster.dpatch: Make sure we swap 12/16 bit
chunky data in raster filter.
* Add debian/patches/svn5523_1_2_4bit_raster.dpatch:
- Fix imagetoraster generation of 1/2/4-bit raster data.
- Fix cupsRasterWritePixels() - bad double line termination.
* Add debian/patches/svn5526_str1676_stopped_jobs_active.dpatch: Fix stopped
jobs to be considered active (STR #1676).
* Add debian/patches/svn5527_LDAP_define.dpatch: Fix typo in #ifdef:
s/OPENDAP/OPENLDAP/.
* Add debian/patches/svn5527_str1683_lpstaterror.dpatch: The lpstat command
displayed the wrong error message for a missing destination (STR #1683).
* Add debian/patches/svn5527_str1689_printeroptions.dpatch: "Set Printer
Options" in the web interface did not update the DefaultImageableArea or
DefaultPaperDimension attributes in the PPD file (STR #1689).
* Add debian/patches/svn5528_str1680_load_custom_options.dpatch: ppdOpen*()
did not load custom options properly (STR #1680).
Modified: cupsys/branches/cups-1.2-ubuntu/debian/changelog
==============================================================================
--- cupsys/branches/cups-1.2-ubuntu/debian/changelog (original)
+++ cupsys/branches/cups-1.2-ubuntu/debian/changelog Tue May 16 10:50:58 2006
@@ -1,8 +1,26 @@
cupsys (1.2.0-0ubuntu3) dapper; urgency=low
- *
+ * Pull some bug fixes from SVN head:
+ * Add debian/patches/svn5512_KCMYcm_fix.dpatch: Fix bug in KCMYcm handling
+ (typo in variable name).
+ * Add debian/patches/svn5518_12bitraster.dpatch: Make sure we swap 12/16 bit
+ chunky data in raster filter.
+ * Add debian/patches/svn5523_1_2_4bit_raster.dpatch:
+ - Fix imagetoraster generation of 1/2/4-bit raster data.
+ - Fix cupsRasterWritePixels() - bad double line termination.
+ * Add debian/patches/svn5526_str1676_stopped_jobs_active.dpatch: Fix stopped
+ jobs to be considered active (STR #1676).
+ * Add debian/patches/svn5527_LDAP_define.dpatch: Fix typo in #ifdef:
+ s/OPENDAP/OPENLDAP/.
+ * Add debian/patches/svn5527_str1683_lpstaterror.dpatch: The lpstat command
+ displayed the wrong error message for a missing destination (STR #1683).
+ * Add debian/patches/svn5527_str1689_printeroptions.dpatch: "Set Printer
+ Options" in the web interface did not update the DefaultImageableArea or
+ DefaultPaperDimension attributes in the PPD file (STR #1689).
+ * Add debian/patches/svn5528_str1680_load_custom_options.dpatch: ppdOpen*()
+ did not load custom options properly (STR #1680).
- -- Martin Pitt <martin.pitt at ubuntu.com> Thu, 11 May 2006 12:48:49 +0200
+ -- Martin Pitt <martin.pitt at ubuntu.com> Tue, 16 May 2006 12:39:35 +0200
cupsys (1.2.0-0ubuntu2) dapper; urgency=low
Modified: cupsys/branches/cups-1.2-ubuntu/debian/patches/00list
==============================================================================
--- cupsys/branches/cups-1.2-ubuntu/debian/patches/00list (original)
+++ cupsys/branches/cups-1.2-ubuntu/debian/patches/00list Tue May 16 10:50:58 2006
@@ -21,3 +21,11 @@
56_revert_svn_5438.dpatch
58_cupsd.conf-AllowLocal.dpatch
ubuntu-nowebadmin.dpatch
+svn5512_KCMYcm_fix.dpatch
+svn5518_12bitraster.dpatch
+svn5523_1_2_4bit_raster.dpatch
+svn5526_str1676_stopped_jobs_active.dpatch
+svn5527_LDAP_define.dpatch
+svn5527_str1683_lpstaterror.dpatch
+svn5527_str1689_printeroptions.dpatch
+svn5528_str1680_load_custom_options.dpatch
Added: cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5512_KCMYcm_fix.dpatch
==============================================================================
--- (empty file)
+++ cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5512_KCMYcm_fix.dpatch Tue May 16 10:50:58 2006
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## svn5512_KCMYcm_fix.dpatch by <martin.pitt at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad cups-1.2-ubuntu~/filter/interpret.c cups-1.2-ubuntu/filter/interpret.c
+--- cups-1.2-ubuntu~/filter/interpret.c 2006-05-06 02:24:22.000000000 +0200
++++ cups-1.2-ubuntu/filter/interpret.c 2006-05-16 12:31:26.000000000 +0200
+@@ -296,7 +296,7 @@
+ break;
+
+ case CUPS_CSPACE_KCMYcm :
+- if (h->cupsBitsPerPixel == 1)
++ if (h->cupsBitsPerColor == 1)
+ {
+ if (h->cupsColorOrder == CUPS_ORDER_CHUNKED)
+ h->cupsBitsPerPixel = 8;
Added: cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5518_12bitraster.dpatch
==============================================================================
--- (empty file)
+++ cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5518_12bitraster.dpatch Tue May 16 10:50:58 2006
@@ -0,0 +1,21 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## svn5518_12bitraster.dpatch by <martin.pitt at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad cups-1.2-ubuntu~/filter/raster.c cups-1.2-ubuntu/filter/raster.c
+--- cups-1.2-ubuntu~/filter/raster.c 2006-02-27 04:08:47.000000000 +0100
++++ cups-1.2-ubuntu/filter/raster.c 2006-05-16 12:31:53.000000000 +0200
+@@ -335,7 +335,9 @@
+ }
+ }
+
+- if (r->header.cupsBitsPerColor == 16 &&
++ if ((r->header.cupsBitsPerColor == 16 ||
++ r->header.cupsBitsPerPixel == 12 ||
++ r->header.cupsBitsPerPixel == 16) &&
+ (r->sync == CUPS_RASTER_REVSYNC || r->sync == CUPS_RASTER_REVSYNCv1))
+ {
+ /*
Added: cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5523_1_2_4bit_raster.dpatch
==============================================================================
--- (empty file)
+++ cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5523_1_2_4bit_raster.dpatch Tue May 16 10:50:58 2006
@@ -0,0 +1,1798 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## svn5523_1_2_4bit_raster.dpatch by <martin.pitt at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad cups-1.2-ubuntu~/filter/imagetoraster.c cups-1.2-ubuntu/filter/imagetoraster.c
+--- cups-1.2-ubuntu~/filter/imagetoraster.c 2006-05-03 01:59:56.000000000 +0200
++++ cups-1.2-ubuntu/filter/imagetoraster.c 2006-05-16 12:33:22.000000000 +0200
+@@ -59,7 +59,7 @@
+ YPosition = 0, /* Vertical position on page */
+ Collate = 0, /* Collate copies? */
+ Copies = 1; /* Number of copies */
+-int Floyd16xc16[16][16] = /* Traditional Floyd ordered dither */
++int Floyd16x16[16][16] = /* Traditional Floyd ordered dither */
+ {
+ { 0, 128, 32, 160, 8, 136, 40, 168,
+ 2, 130, 34, 162, 10, 138, 42, 170 },
+@@ -115,56 +115,6 @@
+
+ cups_ib_t OnPixels[256], /* On-pixel LUT */
+ OffPixels[256]; /* Off-pixel LUT */
+-int Planes[] = /* Number of planes for each colorspace */
+- {
+- 1, /* CUPS_CSPACE_W */
+- 3, /* CUPS_CSPACE_RGB */
+- 4, /* CUPS_CSPACE_RGBA */
+- 1, /* CUPS_CSPACE_K */
+- 3, /* CUPS_CSPACE_CMY */
+- 3, /* CUPS_CSPACE_YMC */
+- 4, /* CUPS_CSPACE_CMYK */
+- 4, /* CUPS_CSPACE_YMCK */
+- 4, /* CUPS_CSPACE_KCMY */
+- 6, /* CUPS_CSPACE_KCMYcm */
+- 4, /* CUPS_CSPACE_GMCK */
+- 4, /* CUPS_CSPACE_GMCS */
+- 1, /* CUPS_CSPACE_WHITE */
+- 1, /* CUPS_CSPACE_GOLD */
+- 1, /* CUPS_CSPACE_SILVER */
+- 3, /* CUPS_CSPACE_CIEXYZ */
+- 3, /* CUPS_CSPACE_CIELab */
+- 4, /* CUPS_CSPACE_RGBW */
+- 0, /* ... reserved ... */
+- 0, /* ... reserved ... */
+- 0, /* ... reserved ... */
+- 0, /* ... reserved ... */
+- 0, /* ... reserved ... */
+- 0, /* ... reserved ... */
+- 0, /* ... reserved ... */
+- 0, /* ... reserved ... */
+- 0, /* ... reserved ... */
+- 0, /* ... reserved ... */
+- 0, /* ... reserved ... */
+- 0, /* ... reserved ... */
+- 0, /* ... reserved ... */
+- 0, /* ... reserved ... */
+- 3, /* CUPS_CSPACE_ICC1 */
+- 3, /* CUPS_CSPACE_ICC2 */
+- 3, /* CUPS_CSPACE_ICC3 */
+- 3, /* CUPS_CSPACE_ICC4 */
+- 3, /* CUPS_CSPACE_ICC5 */
+- 3, /* CUPS_CSPACE_ICC6 */
+- 3, /* CUPS_CSPACE_ICC7 */
+- 3, /* CUPS_CSPACE_ICC8 */
+- 3, /* CUPS_CSPACE_ICC9 */
+- 3, /* CUPS_CSPACE_ICCA */
+- 3, /* CUPS_CSPACE_ICCB */
+- 3, /* CUPS_CSPACE_ICCC */
+- 3, /* CUPS_CSPACE_ICCD */
+- 3, /* CUPS_CSPACE_ICCE */
+- 3 /* CUPS_CSPACE_ICCF */
+- };
+
+
+ /*
+@@ -530,16 +480,32 @@
+ switch (header.cupsColorSpace)
+ {
+ case CUPS_CSPACE_W :
+- primary = CUPS_IMAGE_WHITE;
+- secondary = CUPS_IMAGE_WHITE;
++ if (header.cupsBitsPerColor >= 8)
++ {
++ primary = CUPS_IMAGE_WHITE;
++ secondary = CUPS_IMAGE_WHITE;
++ }
++ else
++ {
++ primary = CUPS_IMAGE_BLACK;
++ secondary = CUPS_IMAGE_BLACK;
++ }
+ break;
+
+ default :
+ case CUPS_CSPACE_RGB :
+ case CUPS_CSPACE_RGBA :
+ case CUPS_CSPACE_RGBW :
+- primary = CUPS_IMAGE_RGB;
+- secondary = CUPS_IMAGE_RGB;
++ if (header.cupsBitsPerColor >= 8)
++ {
++ primary = CUPS_IMAGE_RGB;
++ secondary = CUPS_IMAGE_RGB;
++ }
++ else
++ {
++ primary = CUPS_IMAGE_CMY;
++ secondary = CUPS_IMAGE_CMY;
++ }
+ break;
+
+ case CUPS_CSPACE_K :
+@@ -553,20 +519,10 @@
+ case CUPS_CSPACE_CMYK :
+ case CUPS_CSPACE_YMCK :
+ case CUPS_CSPACE_KCMY :
++ case CUPS_CSPACE_KCMYcm :
+ case CUPS_CSPACE_GMCK :
+ case CUPS_CSPACE_GMCS :
+- primary = CUPS_IMAGE_CMYK;
+- secondary = CUPS_IMAGE_CMYK;
+- break;
+-
+- case CUPS_CSPACE_CMY :
+- case CUPS_CSPACE_YMC :
+- primary = CUPS_IMAGE_CMY;
+- secondary = CUPS_IMAGE_CMY;
+- break;
+-
+- case CUPS_CSPACE_KCMYcm :
+- if (header.cupsBitsPerPixel == 1)
++ if (header.cupsBitsPerColor == 1)
+ {
+ primary = CUPS_IMAGE_CMY;
+ secondary = CUPS_IMAGE_CMY;
+@@ -577,6 +533,13 @@
+ secondary = CUPS_IMAGE_CMYK;
+ }
+ break;
++
++ case CUPS_CSPACE_CMY :
++ case CUPS_CSPACE_YMC :
++ primary = CUPS_IMAGE_CMY;
++ secondary = CUPS_IMAGE_CMY;
++ break;
++ break;
+ }
+
+ /*
+@@ -899,8 +862,12 @@
+ * Set the new custom size...
+ */
+
+- header.PageSize[0] = width + 0.5;
+- header.PageSize[1] = length + 0.5;
++ strcpy(header.cupsPageSizeName, "Custom");
++
++ header.cupsPageSize[0] = width + 0.5;
++ header.cupsPageSize[1] = length + 0.5;
++ header.PageSize[0] = width + 0.5;
++ header.PageSize[1] = length + 0.5;
+
+ /*
+ * Update page variables...
+@@ -926,13 +893,12 @@
+
+ header.cupsWidth = width * header.HWResolution[0] / 72.0;
+ header.cupsHeight = length * header.HWResolution[1] / 72.0;
+- }
+- else
+- {
+- header.cupsWidth = (PageRight - PageLeft) * header.HWResolution[0] / 72.0;
+- header.cupsHeight = (PageTop - PageBottom) * header.HWResolution[1] / 72.0;
+- header.PageSize[0] = PageWidth;
+- header.PageSize[1] = PageLength;
++
++ header.cupsBytesPerLine = (header.cupsBitsPerPixel *
++ header.cupsWidth + 7) / 8;
++
++ if (header.cupsColorOrder == CUPS_ORDER_BANDED)
++ header.cupsBytesPerLine *= header.cupsNumColors;
+ }
+
+ header.Margins[0] = PageLeft;
+@@ -947,32 +913,32 @@
+ switch (XPosition)
+ {
+ case -1 :
+- header.ImagingBoundingBox[0] = PageLeft;
+- header.ImagingBoundingBox[2] = PageLeft + xprint * 72;
++ header.cupsImagingBBox[0] = PageLeft;
++ header.cupsImagingBBox[2] = PageLeft + xprint * 72;
+ break;
+ default :
+- header.ImagingBoundingBox[0] = (PageRight + PageLeft - xprint * 72) / 2;
+- header.ImagingBoundingBox[2] = (PageRight + PageLeft + xprint * 72) / 2;
++ header.cupsImagingBBox[0] = (PageRight + PageLeft - xprint * 72) / 2;
++ header.cupsImagingBBox[2] = (PageRight + PageLeft + xprint * 72) / 2;
+ break;
+ case 1 :
+- header.ImagingBoundingBox[0] = PageRight - xprint * 72;
+- header.ImagingBoundingBox[2] = PageRight;
++ header.cupsImagingBBox[0] = PageRight - xprint * 72;
++ header.cupsImagingBBox[2] = PageRight;
+ break;
+ }
+
+ switch (YPosition)
+ {
+ case -1 :
+- header.ImagingBoundingBox[1] = PageBottom;
+- header.ImagingBoundingBox[3] = PageBottom + yprint * 72;
++ header.cupsImagingBBox[1] = PageBottom;
++ header.cupsImagingBBox[3] = PageBottom + yprint * 72;
+ break;
+ default :
+- header.ImagingBoundingBox[1] = (PageTop + PageBottom - yprint * 72) / 2;
+- header.ImagingBoundingBox[3] = (PageTop + PageBottom + yprint * 72) / 2;
++ header.cupsImagingBBox[1] = (PageTop + PageBottom - yprint * 72) / 2;
++ header.cupsImagingBBox[3] = (PageTop + PageBottom + yprint * 72) / 2;
+ break;
+ case 1 :
+- header.ImagingBoundingBox[1] = PageTop - yprint * 72;
+- header.ImagingBoundingBox[3] = PageTop;
++ header.cupsImagingBBox[1] = PageTop - yprint * 72;
++ header.cupsImagingBBox[3] = PageTop;
+ break;
+ }
+ break;
+@@ -981,32 +947,32 @@
+ switch (XPosition)
+ {
+ case -1 :
+- header.ImagingBoundingBox[0] = PageBottom;
+- header.ImagingBoundingBox[2] = PageBottom + yprint * 72;
++ header.cupsImagingBBox[0] = PageBottom;
++ header.cupsImagingBBox[2] = PageBottom + yprint * 72;
+ break;
+ default :
+- header.ImagingBoundingBox[0] = (PageTop + PageBottom - yprint * 72) / 2;
+- header.ImagingBoundingBox[2] = (PageTop + PageBottom + yprint * 72) / 2;
++ header.cupsImagingBBox[0] = (PageTop + PageBottom - yprint * 72) / 2;
++ header.cupsImagingBBox[2] = (PageTop + PageBottom + yprint * 72) / 2;
+ break;
+ case 1 :
+- header.ImagingBoundingBox[0] = PageTop - yprint * 72;
+- header.ImagingBoundingBox[2] = PageTop;
++ header.cupsImagingBBox[0] = PageTop - yprint * 72;
++ header.cupsImagingBBox[2] = PageTop;
+ break;
+ }
+
+ switch (YPosition)
+ {
+ case -1 :
+- header.ImagingBoundingBox[1] = PageLeft;
+- header.ImagingBoundingBox[3] = PageLeft + xprint * 72;
++ header.cupsImagingBBox[1] = PageLeft;
++ header.cupsImagingBBox[3] = PageLeft + xprint * 72;
+ break;
+ default :
+- header.ImagingBoundingBox[1] = (PageRight + PageLeft - xprint * 72) / 2;
+- header.ImagingBoundingBox[3] = (PageRight + PageLeft + xprint * 72) / 2;
++ header.cupsImagingBBox[1] = (PageRight + PageLeft - xprint * 72) / 2;
++ header.cupsImagingBBox[3] = (PageRight + PageLeft + xprint * 72) / 2;
+ break;
+ case 1 :
+- header.ImagingBoundingBox[1] = PageRight - xprint * 72;
+- header.ImagingBoundingBox[3] = PageRight;
++ header.cupsImagingBBox[1] = PageRight - xprint * 72;
++ header.cupsImagingBBox[3] = PageRight;
+ break;
+ }
+ break;
+@@ -1015,32 +981,32 @@
+ switch (XPosition)
+ {
+ case 1 :
+- header.ImagingBoundingBox[0] = PageLeft;
+- header.ImagingBoundingBox[2] = PageLeft + xprint * 72;
++ header.cupsImagingBBox[0] = PageLeft;
++ header.cupsImagingBBox[2] = PageLeft + xprint * 72;
+ break;
+ default :
+- header.ImagingBoundingBox[0] = (PageRight + PageLeft - xprint * 72) / 2;
+- header.ImagingBoundingBox[2] = (PageRight + PageLeft + xprint * 72) / 2;
++ header.cupsImagingBBox[0] = (PageRight + PageLeft - xprint * 72) / 2;
++ header.cupsImagingBBox[2] = (PageRight + PageLeft + xprint * 72) / 2;
+ break;
+ case -1 :
+- header.ImagingBoundingBox[0] = PageRight - xprint * 72;
+- header.ImagingBoundingBox[2] = PageRight;
++ header.cupsImagingBBox[0] = PageRight - xprint * 72;
++ header.cupsImagingBBox[2] = PageRight;
+ break;
+ }
+
+ switch (YPosition)
+ {
+ case 1 :
+- header.ImagingBoundingBox[1] = PageBottom;
+- header.ImagingBoundingBox[3] = PageBottom + yprint * 72;
++ header.cupsImagingBBox[1] = PageBottom;
++ header.cupsImagingBBox[3] = PageBottom + yprint * 72;
+ break;
+ default :
+- header.ImagingBoundingBox[1] = (PageTop + PageBottom - yprint * 72) / 2;
+- header.ImagingBoundingBox[3] = (PageTop + PageBottom + yprint * 72) / 2;
++ header.cupsImagingBBox[1] = (PageTop + PageBottom - yprint * 72) / 2;
++ header.cupsImagingBBox[3] = (PageTop + PageBottom + yprint * 72) / 2;
+ break;
+ case -1 :
+- header.ImagingBoundingBox[1] = PageTop - yprint * 72;
+- header.ImagingBoundingBox[3] = PageTop;
++ header.cupsImagingBBox[1] = PageTop - yprint * 72;
++ header.cupsImagingBBox[3] = PageTop;
+ break;
+ }
+ break;
+@@ -1049,68 +1015,51 @@
+ switch (XPosition)
+ {
+ case 1 :
+- header.ImagingBoundingBox[0] = PageBottom;
+- header.ImagingBoundingBox[2] = PageBottom + yprint * 72;
++ header.cupsImagingBBox[0] = PageBottom;
++ header.cupsImagingBBox[2] = PageBottom + yprint * 72;
+ break;
+ default :
+- header.ImagingBoundingBox[0] = (PageTop + PageBottom - yprint * 72) / 2;
+- header.ImagingBoundingBox[2] = (PageTop + PageBottom + yprint * 72) / 2;
++ header.cupsImagingBBox[0] = (PageTop + PageBottom - yprint * 72) / 2;
++ header.cupsImagingBBox[2] = (PageTop + PageBottom + yprint * 72) / 2;
+ break;
+ case -1 :
+- header.ImagingBoundingBox[0] = PageTop - yprint * 72;
+- header.ImagingBoundingBox[2] = PageTop;
++ header.cupsImagingBBox[0] = PageTop - yprint * 72;
++ header.cupsImagingBBox[2] = PageTop;
+ break;
+ }
+
+ switch (YPosition)
+ {
+ case 1 :
+- header.ImagingBoundingBox[1] = PageLeft;
+- header.ImagingBoundingBox[3] = PageLeft + xprint * 72;
++ header.cupsImagingBBox[1] = PageLeft;
++ header.cupsImagingBBox[3] = PageLeft + xprint * 72;
+ break;
+ default :
+- header.ImagingBoundingBox[1] = (PageRight + PageLeft - xprint * 72) / 2;
+- header.ImagingBoundingBox[3] = (PageRight + PageLeft + xprint * 72) / 2;
++ header.cupsImagingBBox[1] = (PageRight + PageLeft - xprint * 72) / 2;
++ header.cupsImagingBBox[3] = (PageRight + PageLeft + xprint * 72) / 2;
+ break;
+ case -1 :
+- header.ImagingBoundingBox[1] = PageRight - xprint * 72;
+- header.ImagingBoundingBox[3] = PageRight;
++ header.cupsImagingBBox[1] = PageRight - xprint * 72;
++ header.cupsImagingBBox[3] = PageRight;
+ break;
+ }
+ break;
+ }
+
+- switch (header.cupsColorOrder)
+- {
+- default :
+- header.cupsBytesPerLine = (header.cupsBitsPerPixel *
+- header.cupsWidth + 7) / 8;
+- num_planes = 1;
+- break;
+-
+- case CUPS_ORDER_BANDED :
+- if (header.cupsColorSpace == CUPS_CSPACE_KCMYcm &&
+- header.cupsBitsPerColor > 1)
+- header.cupsBytesPerLine = (header.cupsBitsPerPixel *
+- header.cupsWidth + 7) / 8 * 4;
+- else
+- header.cupsBytesPerLine = (header.cupsBitsPerPixel *
+- header.cupsWidth + 7) / 8 *
+- Planes[header.cupsColorSpace];
+- num_planes = 1;
+- break;
++ header.ImagingBoundingBox[0] = header.cupsImagingBBox[0];
++ header.ImagingBoundingBox[1] = header.cupsImagingBBox[1];
++ header.ImagingBoundingBox[2] = header.cupsImagingBBox[2];
++ header.ImagingBoundingBox[3] = header.cupsImagingBBox[3];
+
+- case CUPS_ORDER_PLANAR :
+- header.cupsBytesPerLine = (header.cupsBitsPerPixel *
+- header.cupsWidth + 7) / 8;
+- num_planes = Planes[header.cupsColorSpace];
+- break;
+- }
++ if (header.cupsColorOrder == CUPS_ORDER_PLANAR)
++ num_planes = header.cupsNumColors;
++ else
++ num_planes = 1;
+
+- if (header.cupsBitsPerColor >= 8)
+- zoom_type = CUPS_IZOOM_NORMAL;
+- else
+- zoom_type = CUPS_IZOOM_FAST;
++ if (header.cupsBitsPerColor >= 8)
++ zoom_type = CUPS_IZOOM_NORMAL;
++ else
++ zoom_type = CUPS_IZOOM_FAST;
+
+ /*
+ * See if we need to collate, and if so how we need to do it...
+@@ -1159,8 +1108,6 @@
+ OnPixels[i] = 17 * (i / 17 + 1);
+ OffPixels[i] = 17 * (i / 16);
+ }
+-
+- OnPixels[255] = OffPixels[255] = 0xff;
+ break;
+ }
+
+@@ -1218,10 +1165,10 @@
+
+ if (Flip)
+ z = _cupsImageZoomNew(img, xc0, yc0, xc1, yc1, -xtemp, ytemp,
+- Orientation & 1, zoom_type);
++ Orientation & 1, zoom_type);
+ else
+ z = _cupsImageZoomNew(img, xc0, yc0, xc1, yc1, xtemp, ytemp,
+- Orientation & 1, zoom_type);
++ Orientation & 1, zoom_type);
+
+ /*
+ * Write leading blank space as needed...
+@@ -1235,6 +1182,8 @@
+ if (YPosition == 0)
+ y /= 2;
+
++ fprintf(stderr, "DEBUG: Writing %d leading blank lines...\n", y);
++
+ for (; y > 0; y --)
+ {
+ if (cupsRasterWritePixels(ras, row, header.cupsBytesPerLine) <
+@@ -1315,14 +1264,17 @@
+ format_YMCK(&header, row, y, plane, z->xsize, z->ysize,
+ yerr0, yerr1, r0, r1);
+ break;
++ case CUPS_CSPACE_KCMYcm :
++ if (header.cupsBitsPerColor == 1)
++ {
++ format_KCMYcm(&header, row, y, plane, z->xsize, z->ysize,
++ yerr0, yerr1, r0, r1);
++ break;
++ }
+ case CUPS_CSPACE_KCMY :
+ format_KCMY(&header, row, y, plane, z->xsize, z->ysize,
+ yerr0, yerr1, r0, r1);
+ break;
+- case CUPS_CSPACE_KCMYcm :
+- format_KCMYcm(&header, row, y, plane, z->xsize, z->ysize,
+- yerr0, yerr1, r0, r1);
+- break;
+ }
+
+ /*
+@@ -1364,6 +1316,8 @@
+ if (YPosition == 0)
+ y = y - y / 2;
+
++ fprintf(stderr, "DEBUG: Writing %d trailing blank lines...\n", y);
++
+ for (; y > 0; y --)
+ {
+ if (cupsRasterWritePixels(ras, row, header.cupsBytesPerLine) <
+@@ -1447,7 +1401,7 @@
+ {
+ case 1 :
+ bitmask = 64 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ for (x = xsize ; x > 0; x --)
+ {
+@@ -1535,7 +1489,7 @@
+ {
+ case 1 :
+ bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ for (x = xsize; x > 0; x --)
+ {
+@@ -1559,7 +1513,7 @@
+ break;
+
+ case 2 :
+- bitmask = 0x0 >> (bitoffset & 7);
++ bitmask = 0xc0 >> (bitoffset & 7);
+ dither = Floyd8x8[y & 7];
+
+ for (x = xsize; x > 0; x --)
+@@ -1583,7 +1537,7 @@
+ bitmask >>= 2;
+ else
+ {
+- bitmask = 0x0;
++ bitmask = 0xc0;
+
+ cptr ++;
+ mptr ++;
+@@ -1653,7 +1607,7 @@
+ {
+ case 1 :
+ bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ switch (z)
+ {
+@@ -1708,7 +1662,7 @@
+ break;
+
+ case 2 :
+- bitmask = 0x0 >> (bitoffset & 7);
++ bitmask = 0xc0 >> (bitoffset & 7);
+ dither = Floyd8x8[y & 7];
+ r0 += z;
+
+@@ -1723,7 +1677,7 @@
+ bitmask >>= 2;
+ else
+ {
+- bitmask = 0x0;
++ bitmask = 0xc0;
+
+ ptr ++;
+ }
+@@ -1797,6 +1751,7 @@
+ int bandwidth; /* Width of a color band */
+ int x, /* Current X coordinate on page */
+ *dither; /* Pointer into dither array */
++ int pc, pm, py; /* CMY pixels */
+
+
+ switch (XPosition)
+@@ -1822,24 +1777,33 @@
+ {
+ case 1 :
+ bitmask = 128 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ for (x = xsize ; x > 0; x --)
+ {
+- if (*r0++ > dither[x & 15])
+- *ptr ^= bitmask;
+- bitmask >>= 1;
++ pc = *r0++ > dither[x & 15];
++ pm = *r0++ > dither[x & 15];
++ py = *r0++ > dither[x & 15];
+
+- if (*r0++ > dither[x & 15])
++ if (pc && pm && py)
++ {
++ bitmask >>= 3;
+ *ptr ^= bitmask;
+- bitmask >>= 1;
++ }
++ else
++ {
++ if (pc)
++ *ptr ^= bitmask;
++ bitmask >>= 1;
+
+- if (*r0++ > dither[x & 15])
+- *ptr ^= bitmask;
+- bitmask >>= 1;
++ if (pm)
++ *ptr ^= bitmask;
++ bitmask >>= 1;
+
+- if (*r0++ > dither[x & 15])
+- *ptr ^= bitmask;
++ if (py)
++ *ptr ^= bitmask;
++ bitmask >>= 1;
++ }
+
+ if (bitmask > 1)
+ bitmask >>= 1;
+@@ -1857,9 +1821,9 @@
+ for (x = xsize ; x > 0; x --, r0 += 4)
+ {
+ if ((r0[0] & 63) > dither[x & 7])
+- *ptr ^= (0x0 & OnPixels[r0[0]]);
++ *ptr ^= (0xc0 & OnPixels[r0[0]]);
+ else
+- *ptr ^= (0x0 & OffPixels[r0[0]]);
++ *ptr ^= (0xc0 & OffPixels[r0[0]]);
+
+ if ((r0[1] & 63) > dither[x & 7])
+ *ptr ^= (0x30 & OnPixels[r0[1]]);
+@@ -1925,18 +1889,25 @@
+ {
+ case 1 :
+ bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ for (x = xsize; x > 0; x --)
+ {
+- if (*r0++ > dither[x & 15])
+- *cptr ^= bitmask;
+- if (*r0++ > dither[x & 15])
+- *mptr ^= bitmask;
+- if (*r0++ > dither[x & 15])
+- *yptr ^= bitmask;
+- if (*r0++ > dither[x & 15])
+- *kptr ^= bitmask;
++ pc = *r0++ > dither[x & 15];
++ pm = *r0++ > dither[x & 15];
++ py = *r0++ > dither[x & 15];
++
++ if (pc && pm && py)
++ *kptr ^= bitmask;
++ else
++ {
++ if (pc)
++ *cptr ^= bitmask;
++ if (pm)
++ *mptr ^= bitmask;
++ if (py)
++ *yptr ^= bitmask;
++ }
+
+ if (bitmask > 1)
+ bitmask >>= 1;
+@@ -1952,7 +1923,7 @@
+ break;
+
+ case 2 :
+- bitmask = 0x0 >> (bitoffset & 7);
++ bitmask = 0xc0 >> (bitoffset & 7);
+ dither = Floyd8x8[y & 7];
+
+ for (x = xsize; x > 0; x --)
+@@ -1981,7 +1952,7 @@
+ bitmask >>= 2;
+ else
+ {
+- bitmask = 0x0;
++ bitmask = 0xc0;
+
+ cptr ++;
+ mptr ++;
+@@ -2063,12 +2034,16 @@
+ {
+ case 1 :
+ bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
+- r0 += z;
++ dither = Floyd16x16[y & 15];
+
+- for (x = xsize; x > 0; x --, r0 += 4)
++ for (x = xsize; x > 0; x --)
+ {
+- if (*r0 > dither[x & 15])
++ pc = *r0++ > dither[x & 15];
++ pm = *r0++ > dither[x & 15];
++ py = *r0++ > dither[x & 15];
++
++ if ((pc && pm && py && z == 3) ||
++ (pc && z == 0) || (pm && z == 1) || (py && z == 2))
+ *ptr ^= bitmask;
+
+ if (bitmask > 1)
+@@ -2082,7 +2057,7 @@
+ break;
+
+ case 2 :
+- bitmask = 0x0 >> (bitoffset & 7);
++ bitmask = 0xc0 >> (bitoffset & 7);
+ dither = Floyd8x8[y & 7];
+ r0 += z;
+
+@@ -2097,7 +2072,7 @@
+ bitmask >>= 2;
+ else
+ {
+- bitmask = 0x0;
++ bitmask = 0xc0;
+
+ ptr ++;
+ }
+@@ -2189,7 +2164,7 @@
+ {
+ case 1 :
+ bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ for (x = xsize; x > 0; x --)
+ {
+@@ -2207,7 +2182,7 @@
+ break;
+
+ case 2 :
+- bitmask = 0x0 >> (bitoffset & 7);
++ bitmask = 0xc0 >> (bitoffset & 7);
+ dither = Floyd8x8[y & 7];
+
+ for (x = xsize; x > 0; x --)
+@@ -2221,7 +2196,7 @@
+ bitmask >>= 2;
+ else
+ {
+- bitmask = 0x0;
++ bitmask = 0xc0;
+
+ ptr ++;
+ }
+@@ -2289,6 +2264,7 @@
+ int bandwidth; /* Width of a color band */
+ int x, /* Current X coordinate on page */
+ *dither; /* Pointer into dither array */
++ int pc, pm, py; /* CMY pixels */
+
+
+ switch (XPosition)
+@@ -2314,24 +2290,33 @@
+ {
+ case 1 :
+ bitmask = 128 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+- for (x = xsize ; x > 0; x --, r0 += 4)
++ for (x = xsize ; x > 0; x --)
+ {
+- if (r0[3] > dither[x & 15])
+- *ptr ^= bitmask;
+- bitmask >>= 1;
++ pc = *r0++ > dither[x & 15];
++ pm = *r0++ > dither[x & 15];
++ py = *r0++ > dither[x & 15];
+
+- if (r0[0] > dither[x & 15])
++ if (pc && pm && py)
++ {
+ *ptr ^= bitmask;
+- bitmask >>= 1;
++ bitmask >>= 3;
++ }
++ else
++ {
++ bitmask >>= 1;
++ if (pc)
++ *ptr ^= bitmask;
+
+- if (r0[1] > dither[x & 15])
+- *ptr ^= bitmask;
+- bitmask >>= 1;
++ bitmask >>= 1;
++ if (pm)
++ *ptr ^= bitmask;
+
+- if (r0[2] > dither[x & 15])
+- *ptr ^= bitmask;
++ bitmask >>= 1;
++ if (py)
++ *ptr ^= bitmask;
++ }
+
+ if (bitmask > 1)
+ bitmask >>= 1;
+@@ -2349,9 +2334,9 @@
+ for (x = xsize ; x > 0; x --, r0 += 4)
+ {
+ if ((r0[3] & 63) > dither[x & 7])
+- *ptr ^= (0x0 & OnPixels[r0[3]]);
++ *ptr ^= (0xc0 & OnPixels[r0[3]]);
+ else
+- *ptr ^= (0x0 & OffPixels[r0[3]]);
++ *ptr ^= (0xc0 & OffPixels[r0[3]]);
+
+ if ((r0[0] & 63) > dither[x & 7])
+ *ptr ^= (0x30 & OnPixels[r0[0]]);
+@@ -2434,18 +2419,25 @@
+ {
+ case 1 :
+ bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ for (x = xsize; x > 0; x --)
+ {
+- if (*r0++ > dither[x & 15])
+- *cptr ^= bitmask;
+- if (*r0++ > dither[x & 15])
+- *mptr ^= bitmask;
+- if (*r0++ > dither[x & 15])
+- *yptr ^= bitmask;
+- if (*r0++ > dither[x & 15])
+- *kptr ^= bitmask;
++ pc = *r0++ > dither[x & 15];
++ pm = *r0++ > dither[x & 15];
++ py = *r0++ > dither[x & 15];
++
++ if (pc && pm && py)
++ *kptr ^= bitmask;
++ else
++ {
++ if (pc)
++ *cptr ^= bitmask;
++ if (pm)
++ *mptr ^= bitmask;
++ if (py)
++ *yptr ^= bitmask;
++ }
+
+ if (bitmask > 1)
+ bitmask >>= 1;
+@@ -2461,7 +2453,7 @@
+ break;
+
+ case 2 :
+- bitmask = 0x0 >> (bitoffset & 7);
++ bitmask = 0xc0 >> (bitoffset & 7);
+ dither = Floyd8x8[y & 7];
+
+ for (x = xsize; x > 0; x --)
+@@ -2490,7 +2482,7 @@
+ bitmask >>= 2;
+ else
+ {
+- bitmask = 0x0;
++ bitmask = 0xc0;
+
+ cptr ++;
+ mptr ++;
+@@ -2572,15 +2564,16 @@
+ {
+ case 1 :
+ bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
+- if (z == 0)
+- r0 += 3;
+- else
+- r0 += z - 1;
++ dither = Floyd16x16[y & 15];
+
+- for (x = xsize; x > 0; x --, r0 += 4)
++ for (x = xsize; x > 0; x --)
+ {
+- if (*r0 > dither[x & 15])
++ pc = *r0++ > dither[x & 15];
++ pm = *r0++ > dither[x & 15];
++ py = *r0++ > dither[x & 15];
++
++ if ((pc && pm && py && z == 0) ||
++ (pc && z == 1) || (pm && z == 2) || (py && z == 3))
+ *ptr ^= bitmask;
+
+ if (bitmask > 1)
+@@ -2594,7 +2587,7 @@
+ break;
+
+ case 2 :
+- bitmask = 0x0 >> (bitoffset & 7);
++ bitmask = 0xc0 >> (bitoffset & 7);
+ dither = Floyd8x8[y & 7];
+ if (z == 0)
+ r0 += 3;
+@@ -2612,7 +2605,7 @@
+ bitmask >>= 2;
+ else
+ {
+- bitmask = 0x0;
++ bitmask = 0xc0;
+
+ ptr ++;
+ }
+@@ -2716,68 +2709,37 @@
+ break;
+ }
+
+- ptr = row + bitoffset / 8;
+- if (header->cupsBitsPerColor == 1)
+- bandwidth = header->cupsBytesPerLine / 6;
+- else
+- bandwidth = header->cupsBytesPerLine / 4;
++ ptr = row + bitoffset / 8;
++ bandwidth = header->cupsBytesPerLine / 6;
+
+ switch (header->cupsColorOrder)
+ {
+ case CUPS_ORDER_CHUNKED :
+- switch (header->cupsBitsPerColor)
+- {
+- case 1 :
+- dither = Floyd16xc16[y & 15];
+-
+- for (x = xsize ; x > 0; x --)
+- {
+- pc = *r0++ > dither[x & 15];
+- pm = *r0++ > dither[x & 15];
+- py = *r0++ > dither[x & 15];
+- pk = *r0++ > dither[x & 15];
+-
+- if (pk)
+- *ptr++ ^= 32; /* Black */
+- else if (pc && pm)
+- *ptr++ ^= 17; /* Blue (cyan + light magenta) */
+- else if (pc && py)
+- *ptr++ ^= 6; /* Green (light cyan + yellow) */
+- else if (pm && py)
+- *ptr++ ^= 12; /* Red (magenta + yellow) */
+- else if (pc)
+- *ptr++ ^= 16;
+- else if (pm)
+- *ptr++ ^= 8;
+- else if (py)
+- *ptr++ ^= 4;
+- }
+- break;
+-
+- case 8 :
+- for (x = xsize; x > 0; x --, r0 += 4, r1 += 4)
+- {
+- if (r0[3] == r1[3])
+- *ptr++ = r0[3];
+- else
+- *ptr++ = (r0[3] * yerr0 + r1[3] * yerr1) / ysize;
+-
+- if (r0[0] == r1[0])
+- *ptr++ = r0[0];
+- else
+- *ptr++ = (r0[0] * yerr0 + r1[0] * yerr1) / ysize;
++ dither = Floyd16x16[y & 15];
+
+- if (r0[1] == r1[1])
+- *ptr++ = r0[1];
+- else
+- *ptr++ = (r0[1] * yerr0 + r1[1] * yerr1) / ysize;
++ for (x = xsize ; x > 0; x --)
++ {
++ pc = *r0++ > dither[x & 15];
++ pm = *r0++ > dither[x & 15];
++ py = *r0++ > dither[x & 15];
++ pk = pc && pm && py;
+
+- if (r0[2] == r1[2])
+- *ptr++ = r0[2];
+- else
+- *ptr++ = (r0[2] * yerr0 + r1[2] * yerr1) / ysize;
+- }
+- break;
++ if (pk)
++ *ptr++ ^= 32; /* Black */
++ else if (pc && pm)
++ *ptr++ ^= 17; /* Blue (cyan + light magenta) */
++ else if (pc && py)
++ *ptr++ ^= 6; /* Green (light cyan + yellow) */
++ else if (pm && py)
++ *ptr++ ^= 12; /* Red (magenta + yellow) */
++ else if (pc)
++ *ptr++ ^= 16;
++ else if (pm)
++ *ptr++ ^= 8;
++ else if (py)
++ *ptr++ ^= 4;
++ else
++ ptr ++;
+ }
+ break;
+
+@@ -2789,221 +2751,89 @@
+ lcptr = ptr + 4 * bandwidth;
+ lmptr = ptr + 5 * bandwidth;
+
+- switch (header->cupsBitsPerColor)
+- {
+- case 1 :
+- bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
+-
+- for (x = xsize; x > 0; x --)
+- {
+- pc = *r0++ > dither[x & 15];
+- pm = *r0++ > dither[x & 15];
+- py = *r0++ > dither[x & 15];
+- pk = *r0++ > dither[x & 15];
+-
+- if (pk)
+- *kptr ^= bitmask; /* Black */
+- else if (pc && pm)
+- {
+- *cptr ^= bitmask; /* Blue (cyan + light magenta) */
+- *lmptr ^= bitmask;
+- }
+- else if (pc && py)
+- {
+- *lcptr ^= bitmask; /* Green (light cyan + yellow) */
+- *yptr ^= bitmask;
+- }
+- else if (pm && py)
+- {
+- *mptr ^= bitmask; /* Red (magenta + yellow) */
+- *yptr ^= bitmask;
+- }
+- else if (pc)
+- *cptr ^= bitmask;
+- else if (pm)
+- *mptr ^= bitmask;
+- else if (py)
+- *yptr ^= bitmask;
+-
+- if (bitmask > 1)
+- bitmask >>= 1;
+- else
+- {
+- bitmask = 0x80;
+- cptr ++;
+- mptr ++;
+- yptr ++;
+- kptr ++;
+- lcptr ++;
+- lmptr ++;
+- }
+- }
+- break;
+-
+- case 8 :
+- for (x = xsize; x > 0; x --, r0 += 4, r1 += 4)
+- {
+- if (r0[0] == r1[0])
+- *cptr++ = r0[0];
+- else
+- *cptr++ = (r0[0] * yerr0 + r1[0] * yerr1) / ysize;
++ bitmask = 0x80 >> (bitoffset & 7);
++ dither = Floyd16x16[y & 15];
+
+- if (r0[1] == r1[1])
+- *mptr++ = r0[1];
+- else
+- *mptr++ = (r0[1] * yerr0 + r1[1] * yerr1) / ysize;
++ for (x = xsize; x > 0; x --)
++ {
++ pc = *r0++ > dither[x & 15];
++ pm = *r0++ > dither[x & 15];
++ py = *r0++ > dither[x & 15];
++ pk = pc && pm && py;
+
+- if (r0[2] == r1[2])
+- *yptr++ = r0[2];
+- else
+- *yptr++ = (r0[2] * yerr0 + r1[2] * yerr1) / ysize;
++ if (pk)
++ *kptr ^= bitmask; /* Black */
++ else if (pc && pm)
++ {
++ *cptr ^= bitmask; /* Blue (cyan + light magenta) */
++ *lmptr ^= bitmask;
++ }
++ else if (pc && py)
++ {
++ *lcptr ^= bitmask; /* Green (light cyan + yellow) */
++ *yptr ^= bitmask;
++ }
++ else if (pm && py)
++ {
++ *mptr ^= bitmask; /* Red (magenta + yellow) */
++ *yptr ^= bitmask;
++ }
++ else if (pc)
++ *cptr ^= bitmask;
++ else if (pm)
++ *mptr ^= bitmask;
++ else if (py)
++ *yptr ^= bitmask;
+
+- if (r0[3] == r1[3])
+- *kptr++ = r0[3];
+- else
+- *kptr++ = (r0[3] * yerr0 + r1[3] * yerr1) / ysize;
+- }
+- break;
+- }
++ if (bitmask > 1)
++ bitmask >>= 1;
++ else
++ {
++ bitmask = 0x80;
++ cptr ++;
++ mptr ++;
++ yptr ++;
++ kptr ++;
++ lcptr ++;
++ lmptr ++;
++ }
++ }
+ break;
+
+ case CUPS_ORDER_PLANAR :
+- switch (header->cupsBitsPerColor)
+- {
+- case 1 :
+- bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
+-
+- switch (z)
+- {
+- case 0 :
+- for (x = xsize; x > 0; x --, r0 += 4)
+- {
+- if (r0[3] > dither[x & 15])
+- *ptr ^= bitmask;
+-
+- if (bitmask > 1)
+- bitmask >>= 1;
+- else
+- {
+- bitmask = 0x80;
+- ptr ++;
+- }
+- }
+- break;
+-
+- case 1 :
+- for (x = xsize; x > 0; x --, r0 += 4)
+- {
+- if (r0[0] > dither[x & 15] &&
+- r0[2] < dither[x & 15])
+- *ptr ^= bitmask;
+-
+- if (bitmask > 1)
+- bitmask >>= 1;
+- else
+- {
+- bitmask = 0x80;
+- ptr ++;
+- }
+- }
+- break;
+-
+- case 2 :
+- for (x = xsize; x > 0; x --, r0 += 4)
+- {
+- if (r0[1] > dither[x & 15] &&
+- (r0[0] < dither[x & 15] ||
+- r0[2] > dither[x & 15]))
+- *ptr ^= bitmask;
+-
+- if (bitmask > 1)
+- bitmask >>= 1;
+- else
+- {
+- bitmask = 0x80;
+- ptr ++;
+- }
+- }
+- break;
+-
+- case 3 :
+- for (x = xsize; x > 0; x --, r0 += 4)
+- {
+- if (r0[2] > dither[x & 15] &&
+- (r0[0] < dither[x & 15] ||
+- r0[1] < dither[x & 15]))
+- *ptr ^= bitmask;
+-
+- if (bitmask > 1)
+- bitmask >>= 1;
+- else
+- {
+- bitmask = 0x80;
+- ptr ++;
+- }
+- }
+- break;
+-
+- case 4 :
+- for (x = xsize; x > 0; x --, r0 += 4)
+- {
+- if (r0[0] > dither[x & 15] &&
+- r0[2] > dither[x & 15])
+- *ptr ^= bitmask;
+-
+- if (bitmask > 1)
+- bitmask >>= 1;
+- else
+- {
+- bitmask = 0x80;
+- ptr ++;
+- }
+- }
+- break;
+-
+- case 5 :
+- for (x = xsize; x > 0; x --, r0 += 4)
+- {
+- if (r0[0] > dither[x & 15] &&
+- r0[1] > dither[x & 15] &&
+- r0[2] < dither[x & 15])
+- *ptr ^= bitmask;
++ bitmask = 0x80 >> (bitoffset & 7);
++ dither = Floyd16x16[y & 15];
+
+- if (bitmask > 1)
+- bitmask >>= 1;
+- else
+- {
+- bitmask = 0x80;
+- ptr ++;
+- }
+- }
+- break;
+- }
+- break;
++ for (x = xsize; x > 0; x --)
++ {
++ pc = *r0++ > dither[x & 15];
++ pm = *r0++ > dither[x & 15];
++ py = *r0++ > dither[x & 15];
++ pk = pc && pm && py;
+
+- case 8 :
+- if (z == 0)
+- {
+- r0 += 3;
+- r1 += 3;
+- }
+- else
+- {
+- r0 += z - 1;
+- r1 += z - 1;
+- }
++ if (pk && z == 0)
++ *ptr ^= bitmask;
++ else if (pc && pm && (z == 1 || z == 5))
++ *ptr ^= bitmask; /* Blue (cyan + light magenta) */
++ else if (pc && py && (z == 3 || z == 4))
++ *ptr ^= bitmask; /* Green (light cyan + yellow) */
++ else if (pm && py && (z == 2 || z == 3))
++ *ptr ^= bitmask; /* Red (magenta + yellow) */
++ else if (pc && z == 1)
++ *ptr ^= bitmask;
++ else if (pm && z == 2)
++ *ptr ^= bitmask;
++ else if (py && z == 3)
++ *ptr ^= bitmask;
+
+- for (x = xsize; x > 0; x --, r0 += 4, r1 += 4)
+- {
+- if (*r0 == *r1)
+- *ptr++ = *r0;
+- else
+- *ptr++ = (*r0 * yerr0 + *r1 * yerr1) / ysize;
+- }
+- break;
+- }
++ if (bitmask > 1)
++ bitmask >>= 1;
++ else
++ {
++ bitmask = 0x80;
++ ptr ++;
++ }
++ }
+ break;
+ }
+ }
+@@ -3059,7 +2889,7 @@
+ {
+ case 1 :
+ bitmask = 128 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ for (x = xsize ; x > 0; x --)
+ {
+@@ -3075,14 +2905,11 @@
+ *ptr ^= bitmask;
+
+ if (bitmask > 2)
+- {
+- *ptr ^= 16;
+ bitmask >>= 2;
+- }
+ else
+ {
+ bitmask = 128;
+- *ptr++ ^= 1;
++ ptr ++;
+ }
+ }
+ break;
+@@ -3093,9 +2920,9 @@
+ for (x = xsize ; x > 0; x --, r0 += 3)
+ {
+ if ((r0[0] & 63) > dither[x & 7])
+- *ptr ^= (0x0 & OnPixels[r0[0]]);
++ *ptr ^= (0xc0 & OnPixels[r0[0]]);
+ else
+- *ptr ^= (0x0 & OffPixels[r0[0]]);
++ *ptr ^= (0xc0 & OffPixels[r0[0]]);
+
+ if ((r0[1] & 63) > dither[x & 7])
+ *ptr ^= (0x30 & OnPixels[r0[1]]);
+@@ -3107,7 +2934,7 @@
+ else
+ *ptr ^= (0x0c & OffPixels[r0[2]]);
+
+- *ptr++ ^= 0x03;
++ ptr ++;
+ }
+ break;
+
+@@ -3131,7 +2958,7 @@
+ else
+ *ptr ^= (0xf0 & OffPixels[r0[2]]);
+
+- *ptr++ ^= 0x0f;
++ ptr ++;
+ }
+ break;
+
+@@ -3153,7 +2980,7 @@
+ else
+ *ptr++ = (r0[2] * yerr0 + r1[2] * yerr1) / ysize;
+
+- *ptr++ = 255;
++ ptr ++;
+ }
+ break;
+ }
+@@ -3170,7 +2997,7 @@
+ {
+ case 1 :
+ bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ for (x = xsize; x > 0; x --)
+ {
+@@ -3194,7 +3021,7 @@
+ break;
+
+ case 2 :
+- bitmask = 0x0 >> (bitoffset & 7);
++ bitmask = 0xc0 >> (bitoffset & 7);
+ dither = Floyd8x8[y & 7];
+
+ for (x = xsize; x > 0; x --)
+@@ -3218,7 +3045,7 @@
+ bitmask >>= 2;
+ else
+ {
+- bitmask = 0x0;
++ bitmask = 0xc0;
+
+ cptr ++;
+ mptr ++;
+@@ -3294,7 +3121,7 @@
+ {
+ case 1 :
+ bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ switch (z)
+ {
+@@ -3349,7 +3176,7 @@
+ break;
+
+ case 2 :
+- bitmask = 0x0 >> (bitoffset & 7);
++ bitmask = 0xc0 >> (bitoffset & 7);
+ dither = Floyd8x8[y & 7];
+ r0 += z;
+
+@@ -3364,7 +3191,7 @@
+ bitmask >>= 2;
+ else
+ {
+- bitmask = 0x0;
++ bitmask = 0xc0;
+
+ ptr ++;
+ }
+@@ -3456,7 +3283,7 @@
+ {
+ case 1 :
+ bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ for (x = xsize; x > 0; x --)
+ {
+@@ -3474,7 +3301,7 @@
+ break;
+
+ case 2 :
+- bitmask = 0x0 >> (bitoffset & 7);
++ bitmask = 0xc0 >> (bitoffset & 7);
+ dither = Floyd8x8[y & 7];
+
+ for (x = xsize; x > 0; x --)
+@@ -3488,7 +3315,7 @@
+ bitmask >>= 2;
+ else
+ {
+- bitmask = 0x0;
++ bitmask = 0xc0;
+
+ ptr ++;
+ }
+@@ -3580,7 +3407,7 @@
+ {
+ case 1 :
+ bitmask = 64 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ for (x = xsize ; x > 0; x --, r0 += 3)
+ {
+@@ -3680,7 +3507,7 @@
+ {
+ case 1 :
+ bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ for (x = xsize; x > 0; x --)
+ {
+@@ -3704,7 +3531,7 @@
+ break;
+
+ case 2 :
+- bitmask = 0x0 >> (bitoffset & 7);
++ bitmask = 0xc0 >> (bitoffset & 7);
+ dither = Floyd8x8[y & 7];
+
+ for (x = xsize; x > 0; x --)
+@@ -3728,7 +3555,7 @@
+ bitmask >>= 2;
+ else
+ {
+- bitmask = 0x0;
++ bitmask = 0xc0;
+
+ cptr ++;
+ mptr ++;
+@@ -3798,7 +3625,7 @@
+ {
+ case 1 :
+ bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ switch (z)
+ {
+@@ -3853,7 +3680,7 @@
+ break;
+
+ case 2 :
+- bitmask = 0x0 >> (bitoffset & 7);
++ bitmask = 0xc0 >> (bitoffset & 7);
+ dither = Floyd8x8[y & 7];
+ z = 2 - z;
+ r0 += z;
+@@ -3869,7 +3696,7 @@
+ bitmask >>= 2;
+ else
+ {
+- bitmask = 0x0;
++ bitmask = 0xc0;
+
+ ptr ++;
+ }
+@@ -3945,6 +3772,7 @@
+ int bandwidth; /* Width of a color band */
+ int x, /* Current X coordinate on page */
+ *dither; /* Pointer into dither array */
++ int pc, pm, py; /* CMY pixels */
+
+
+ switch (XPosition)
+@@ -3970,24 +3798,33 @@
+ {
+ case 1 :
+ bitmask = 128 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+- for (x = xsize ; x > 0; x --, r0 += 4)
++ for (x = xsize ; x > 0; x --)
+ {
+- if (r0[2] > dither[x & 15])
+- *ptr ^= bitmask;
+- bitmask >>= 1;
++ pc = *r0++ > dither[x & 15];
++ pm = *r0++ > dither[x & 15];
++ py = *r0++ > dither[x & 15];
+
+- if (r0[1] > dither[x & 15])
++ if (pc && pm && py)
++ {
++ bitmask >>= 3;
+ *ptr ^= bitmask;
+- bitmask >>= 1;
++ }
++ else
++ {
++ if (py)
++ *ptr ^= bitmask;
++ bitmask >>= 1;
+
+- if (r0[0] > dither[x & 15])
+- *ptr ^= bitmask;
+- bitmask >>= 1;
++ if (pm)
++ *ptr ^= bitmask;
++ bitmask >>= 1;
+
+- if (r0[3] > dither[x & 15])
+- *ptr ^= bitmask;
++ if (pc)
++ *ptr ^= bitmask;
++ bitmask >>= 1;
++ }
+
+ if (bitmask > 1)
+ bitmask >>= 1;
+@@ -4006,9 +3843,9 @@
+ for (x = xsize ; x > 0; x --, r0 += 4)
+ {
+ if ((r0[2] & 63) > dither[x & 7])
+- *ptr ^= (0x0 & OnPixels[r0[2]]);
++ *ptr ^= (0xc0 & OnPixels[r0[2]]);
+ else
+- *ptr ^= (0x0 & OffPixels[r0[2]]);
++ *ptr ^= (0xc0 & OffPixels[r0[2]]);
+
+ if ((r0[1] & 63) > dither[x & 7])
+ *ptr ^= (0x30 & OnPixels[r0[1]]);
+@@ -4091,18 +3928,25 @@
+ {
+ case 1 :
+ bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
++ dither = Floyd16x16[y & 15];
+
+ for (x = xsize; x > 0; x --)
+ {
+- if (*r0++ > dither[x & 15])
+- *cptr ^= bitmask;
+- if (*r0++ > dither[x & 15])
+- *mptr ^= bitmask;
+- if (*r0++ > dither[x & 15])
+- *yptr ^= bitmask;
+- if (*r0++ > dither[x & 15])
+- *kptr ^= bitmask;
++ pc = *r0++ > dither[x & 15];
++ pm = *r0++ > dither[x & 15];
++ py = *r0++ > dither[x & 15];
++
++ if (pc && pm && py)
++ *kptr ^= bitmask;
++ else
++ {
++ if (pc)
++ *cptr ^= bitmask;
++ if (pm)
++ *mptr ^= bitmask;
++ if (py)
++ *yptr ^= bitmask;
++ }
+
+ if (bitmask > 1)
+ bitmask >>= 1;
+@@ -4119,7 +3963,7 @@
+ break;
+
+ case 2 :
+- bitmask = 0x0 >> (bitoffset & 7);
++ bitmask = 0xc0 >> (bitoffset & 7);
+ dither = Floyd8x8[y & 7];
+
+ for (x = xsize; x > 0; x --)
+@@ -4148,7 +3992,7 @@
+ bitmask >>= 2;
+ else
+ {
+- bitmask = 0x0;
++ bitmask = 0xc0;
+
+ cptr ++;
+ mptr ++;
+@@ -4230,16 +4074,16 @@
+ {
+ case 1 :
+ bitmask = 0x80 >> (bitoffset & 7);
+- dither = Floyd16xc16[y & 15];
+-
+- if (z < 3)
+- r0 += 2 - z;
+- else
+- r0 += z;
++ dither = Floyd16x16[y & 15];
+
+- for (x = xsize; x > 0; x --, r0 += 4)
++ for (x = xsize; x > 0; x --)
+ {
+- if (*r0 > dither[x & 15])
++ pc = *r0++ > dither[x & 15];
++ pm = *r0++ > dither[x & 15];
++ py = *r0++ > dither[x & 15];
++
++ if ((pc && pm && py && z == 3) ||
++ (pc && z == 2) || (pm && z == 1) || (py && z == 0))
+ *ptr ^= bitmask;
+
+ if (bitmask > 1)
+@@ -4253,7 +4097,7 @@
+ break;
+
+ case 2 :
+- bitmask = 0x0 >> (bitoffset & 7);
++ bitmask = 0xc0 >> (bitoffset & 7);
+ dither = Floyd8x8[y & 7];
+ if (z == 3)
+ r0 += 3;
+@@ -4271,7 +4115,7 @@
+ bitmask >>= 2;
+ else
+ {
+- bitmask = 0x0;
++ bitmask = 0xc0;
+
+ ptr ++;
+ }
+diff -urNad cups-1.2-ubuntu~/filter/raster.c cups-1.2-ubuntu/filter/raster.c
+--- cups-1.2-ubuntu~/filter/raster.c 2006-05-16 12:33:08.000000000 +0200
++++ cups-1.2-ubuntu/filter/raster.c 2006-05-16 12:33:22.000000000 +0200
+@@ -480,12 +480,16 @@
+ unsigned remaining; /* Bytes remaining */
+
+
++#ifdef DEBUG
++ fprintf(stderr, "cupsRasterWritePixels(r=%p, p=%p, len=%u), remaining=%u\n",
++ r, p, len, r->remaining);
++#endif /* DEBUG */
++
+ if (r == NULL || r->mode != CUPS_RASTER_WRITE || r->remaining == 0)
+ return (0);
+
+- remaining = len;
++ for (remaining = len; remaining > 0; remaining -= bytes, p += bytes)
+
+- while (remaining > 0)
+ {
+ /*
+ * Figure out the number of remaining bytes on the current line...
+@@ -529,14 +533,19 @@
+ */
+
+ r->remaining --;
++
+ if (r->remaining == 0)
+ return (cups_raster_write(r));
+ else if (r->count == 256)
+ {
+- cups_raster_write(r);
++ if (cups_raster_write(r) == 0)
++ return (0);
++
+ r->count = 0;
+ }
+ }
++
++ continue;
+ }
+ }
+
+@@ -564,13 +573,11 @@
+ */
+
+ r->remaining --;
++
+ if (r->remaining == 0)
+ return (cups_raster_write(r));
+ }
+ }
+-
+- remaining -= bytes;
+- p += bytes;
+ }
+
+ return (len);
+@@ -752,6 +759,10 @@
+ int count; /* Count */
+
+
++#ifdef DEBUG
++ fprintf(stderr, "cups_raster_write(r=%p)\n", r);
++#endif /* DEBUG */
++
+ /*
+ * Write the row repeat count...
+ */
+@@ -759,7 +770,14 @@
+ byte = r->count - 1;
+
+ if (cups_write(r->fd, &byte, 1) < 1)
++ {
++#ifdef DEBUG
++ fputs("cups_raster_write: Unable to write row repeat count...\n",
++ stderr);
++#endif /* DEBUG */
++
+ return (0);
++ }
+
+ /*
+ * Write using a modified TIFF "packbits" compression...
+@@ -778,10 +796,22 @@
+
+ byte = 0;
+ if (cups_write(r->fd, &byte, 1) < 1)
++ {
++#ifdef DEBUG
++ fputs("cups_raster_write: Unable to write last pixel count...\n", stderr);
++#endif /* DEBUG */
++
+ return (0);
++ }
+
+ if (cups_write(r->fd, start, r->bpp) < r->bpp)
++ {
++#ifdef DEBUG
++ fputs("cups_raster_write: Unable to write last pixel data...\n", stderr);
++#endif /* DEBUG */
++
+ return (0);
++ }
+ }
+ else if (!memcmp(start, ptr, r->bpp))
+ {
+@@ -798,10 +828,22 @@
+ byte = count - 1;
+
+ if (cups_write(r->fd, &byte, 1) < 1)
++ {
++#ifdef DEBUG
++ fputs("cups_raster_write: Unable to write repeated pixel count...\n", stderr);
++#endif /* DEBUG */
++
+ return (0);
++ }
+
+ if (cups_write(r->fd, start, r->bpp) < r->bpp)
++ {
++#ifdef DEBUG
++ fputs("cups_raster_write: Unable to write repeated pixel data...\n", stderr);
++#endif /* DEBUG */
++
+ return (0);
++ }
+ }
+ else
+ {
+@@ -822,12 +864,24 @@
+ byte = 257 - count;
+
+ if (cups_write(r->fd, &byte, 1) < 1)
++ {
++#ifdef DEBUG
++ fputs("cups_raster_write: Unable to write non-repeating pixel count...\n", stderr);
++#endif /* DEBUG */
++
+ return (0);
++ }
+
+ count *= r->bpp;
+
+ if (cups_write(r->fd, start, count) < count)
++ {
++#ifdef DEBUG
++ fputs("cups_raster_write: Unable to write non-repeating pixel data...\n", stderr);
++#endif /* DEBUG */
++
+ return (0);
++ }
+ }
+ }
+
Added: cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5526_str1676_stopped_jobs_active.dpatch
==============================================================================
--- (empty file)
+++ cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5526_str1676_stopped_jobs_active.dpatch Tue May 16 10:50:58 2006
@@ -0,0 +1,37 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## svn5526_str1676_stopped_jobs_active.dpatch by <martin.pitt at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad cups-1.2-ubuntu~/scheduler/job.c cups-1.2-ubuntu/scheduler/job.c
+--- cups-1.2-ubuntu~/scheduler/job.c 2006-05-05 19:44:36.000000000 +0200
++++ cups-1.2-ubuntu/scheduler/job.c 2006-05-16 12:34:21.000000000 +0200
+@@ -879,7 +879,7 @@
+
+ if (job->attrs)
+ {
+- if (job->state_value >= IPP_JOB_STOPPED)
++ if (job->state_value > IPP_JOB_STOPPED)
+ job->access_time = time(NULL);
+
+ return;
+@@ -2027,7 +2027,7 @@
+ {
+ cupsArrayAdd(Jobs, job);
+
+- if (job->state_value < IPP_JOB_STOPPED)
++ if (job->state_value <= IPP_JOB_STOPPED)
+ {
+ cupsArrayAdd(ActiveJobs, job);
+ cupsdLoadJob(job);
+@@ -2285,7 +2285,7 @@
+
+ cupsArrayAdd(Jobs, job);
+
+- if (job->state_value < IPP_JOB_STOPPED)
++ if (job->state_value <= IPP_JOB_STOPPED)
+ cupsArrayAdd(ActiveJobs,job);
+ else
+ unload_job(job);
Added: cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5527_LDAP_define.dpatch
==============================================================================
--- (empty file)
+++ cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5527_LDAP_define.dpatch Tue May 16 10:50:58 2006
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## svn5527_LDAP_define.dpatch by <martin.pitt at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad cups-1.2-ubuntu~/scheduler/dirsvc.c cups-1.2-ubuntu/scheduler/dirsvc.c
+--- cups-1.2-ubuntu~/scheduler/dirsvc.c 2006-04-22 05:57:26.000000000 +0200
++++ cups-1.2-ubuntu/scheduler/dirsvc.c 2006-05-16 12:35:34.000000000 +0200
+@@ -1161,7 +1161,7 @@
+ }
+ #endif /* HAVE_LIBSLP */
+
+-#ifdef HAVE_OPENDAP
++#ifdef HAVE_OPENLDAP
+ if (((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_LDAP) &&
+ BrowseLDAPHandle)
+ {
Added: cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5527_str1683_lpstaterror.dpatch
==============================================================================
--- (empty file)
+++ cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5527_str1683_lpstaterror.dpatch Tue May 16 10:50:58 2006
@@ -0,0 +1,25 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## svn5527_str1683_lpstaterror.dpatch by <martin.pitt at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad cups-1.2-ubuntu~/systemv/lpstat.c cups-1.2-ubuntu/systemv/lpstat.c
+--- cups-1.2-ubuntu~/systemv/lpstat.c 2006-03-23 22:21:19.000000000 +0100
++++ cups-1.2-ubuntu/systemv/lpstat.c 2006-05-16 12:38:06.000000000 +0200
+@@ -235,10 +235,10 @@
+ }
+ else
+ {
+- _cupsLangPuts(stderr,
+- _("%s: Error - expected destination after "
+- "\'-b\' option!\n"),
+- argv[0]);
++ _cupsLangPrintf(stderr,
++ _("%s: Error - expected destination after "
++ "\'-b\' option!\n"),
++ argv[0]);
+
+ return (1);
+ }
Added: cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5527_str1689_printeroptions.dpatch
==============================================================================
--- (empty file)
+++ cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5527_str1689_printeroptions.dpatch Tue May 16 10:50:58 2006
@@ -0,0 +1,21 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## svn5527_str1689_printeroptions.dpatch by <martin.pitt at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad cups-1.2-ubuntu~/cgi-bin/admin.c cups-1.2-ubuntu/cgi-bin/admin.c
+--- cups-1.2-ubuntu~/cgi-bin/admin.c 2006-04-18 21:59:05.000000000 +0200
++++ cups-1.2-ubuntu/cgi-bin/admin.c 2006-05-16 12:36:43.000000000 +0200
+@@ -1489,7 +1489,9 @@
+
+ *keyptr = '\0';
+
+- if (!strcmp(keyword, "PageRegion"))
++ if (!strcmp(keyword, "PageRegion") ||
++ !strcmp(keyword, "PaperDimension") ||
++ !strcmp(keyword, "ImageableArea"))
+ var = cgiGetVariable("PageSize");
+ else
+ var = cgiGetVariable(keyword);
Added: cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5528_str1680_load_custom_options.dpatch
==============================================================================
--- (empty file)
+++ cupsys/branches/cups-1.2-ubuntu/debian/patches/svn5528_str1680_load_custom_options.dpatch Tue May 16 10:50:58 2006
@@ -0,0 +1,65 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## svn5528_str1680_load_custom_options.dpatch by <martin.pitt at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad cups-1.2-ubuntu~/cups/mark.c cups-1.2-ubuntu/cups/mark.c
+--- cups-1.2-ubuntu~/cups/mark.c 2006-03-07 05:41:42.000000000 +0100
++++ cups-1.2-ubuntu/cups/mark.c 2006-05-16 12:38:56.000000000 +0200
+@@ -241,9 +241,6 @@
+ ppdFindOption(ppd_file_t *ppd, /* I - PPD file data */
+ const char *option) /* I - Option/Keyword name */
+ {
+- ppd_option_t key; /* Option search key */
+-
+-
+ /*
+ * Range check input...
+ */
+@@ -251,13 +248,39 @@
+ if (!ppd || !option)
+ return (NULL);
+
+- /*
+- * Search...
+- */
++ if (ppd->options)
++ {
++ /*
++ * Search in the array...
++ */
+
+- strlcpy(key.keyword, option, sizeof(key.keyword));
++ ppd_option_t key; /* Option search key */
+
+- return ((ppd_option_t *)cupsArrayFind(ppd->options, &key));
++
++ strlcpy(key.keyword, option, sizeof(key.keyword));
++
++ return ((ppd_option_t *)cupsArrayFind(ppd->options, &key));
++ }
++ else
++ {
++ /*
++ * Search in each group...
++ */
++
++ int i, j; /* Looping vars */
++ ppd_group_t *group; /* Current group */
++ ppd_option_t *optptr; /* Current option */
++
++
++ for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++)
++ for (j = group->num_options, optptr = group->options;
++ j > 0;
++ j --, optptr ++)
++ if (!strcasecmp(optptr->keyword, option))
++ return (optptr);
++
++ return (NULL);
++ }
+ }
+
+
More information about the Pkg-cups-devel
mailing list