[arch-commits] Commit in ghostscript/trunk (PKGBUILD ghostscript-cups-rgbw.patch)
andyrtr at archlinux.org
andyrtr at archlinux.org
Mon Aug 22 16:46:29 UTC 2011
Date: Monday, August 22, 2011 @ 12:46:29
Author: andyrtr
Revision: 136085
upgpkg: ghostscript 9.04-5
update the upstream patch to fix broken color printing as per upstream recommendation. Took the updated Fedora patch
Modified:
ghostscript/trunk/PKGBUILD
ghostscript/trunk/ghostscript-cups-rgbw.patch
-----------------------------+
PKGBUILD | 4 -
ghostscript-cups-rgbw.patch | 120 +++++++++++++++++++++++++++---------------
2 files changed, 80 insertions(+), 44 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2011-08-22 14:13:59 UTC (rev 136084)
+++ PKGBUILD 2011-08-22 16:46:29 UTC (rev 136085)
@@ -3,7 +3,7 @@
pkgname=ghostscript
pkgver=9.04
-pkgrel=4
+pkgrel=5
pkgdesc="An interpreter for the PostScript language"
arch=('i686' 'x86_64')
license=('GPL3' 'custom')
@@ -16,7 +16,7 @@
ghostscript-cups-rgbw.patch)
options=('!libtool' '!makeflags')
md5sums=('9f6899e821ab6d78ab2c856f10fa3023'
- '7c1477e1cadd9c451ea8d6ec3fbbc670')
+ 'bc56eb8c5fef0ecf964f6b3e9b7e65ae')
build() {
cd ${srcdir}/ghostscript-${pkgver}
Modified: ghostscript-cups-rgbw.patch
===================================================================
--- ghostscript-cups-rgbw.patch 2011-08-22 14:13:59 UTC (rev 136084)
+++ ghostscript-cups-rgbw.patch 2011-08-22 16:46:29 UTC (rev 136085)
@@ -1,6 +1,6 @@
diff -up ghostscript-9.04/cups/gdevcups.c.cups-rgbw ghostscript-9.04/cups/gdevcups.c
---- ghostscript-9.04/cups/gdevcups.c.cups-rgbw 2011-08-16 14:47:10.311813968 +0100
-+++ ghostscript-9.04/cups/gdevcups.c 2011-08-16 14:48:02.291224871 +0100
+--- ghostscript-9.04/cups/gdevcups.c.cups-rgbw 2011-08-05 12:12:21.000000000 +0100
++++ ghostscript-9.04/cups/gdevcups.c 2011-08-22 10:54:24.614010581 +0100
@@ -225,6 +225,7 @@ typedef struct gx_device_cups_s
unsigned short EncodeLUT[gx_max_color_value + 1];/* RGB value to output color LUT */
int Density[CUPS_MAX_VALUE + 1];/* Density LUT */
@@ -17,7 +17,7 @@
3 /* cupsRasterVersion */
};
-@@ -1183,15 +1185,18 @@ cups_map_cmyk(gx_device *pdev, /* I - D
+@@ -1182,15 +1184,18 @@ cups_map_cmyk(gx_device *pdev, /* I - D
case CUPS_CSPACE_RGB :
case CUPS_CSPACE_RGBW :
@@ -44,7 +44,7 @@
}
if (c0 < 0)
-@@ -1213,11 +1218,12 @@ cups_map_cmyk(gx_device *pdev, /* I - D
+@@ -1212,11 +1217,12 @@ cups_map_cmyk(gx_device *pdev, /* I - D
out[2] = frac_1 - (frac)cups->Density[c2];
if (cups->header.cupsColorSpace == CUPS_CSPACE_RGBW) {
@@ -62,7 +62,7 @@
}
break;
-@@ -2035,10 +2041,15 @@ cups_map_color_rgb(gx_device *pdev,
+@@ -2034,10 +2040,15 @@ cups_map_color_rgb(gx_device *pdev,
* cups->DecodeLUT actually maps to RGBW, not CMYK...
*/
@@ -82,7 +82,7 @@
if (c > gx_max_color_value)
prgb[0] = gx_max_color_value;
-@@ -2283,20 +2294,20 @@ cups_map_rgb_color(gx_device *pdev,
+@@ -2282,20 +2293,20 @@ cups_map_rgb_color(gx_device *pdev,
switch (cups->header.cupsBitsPerColor)
{
default :
@@ -108,15 +108,19 @@
break;
#endif /* GX_COLOR_INDEX_TYPE */
}
-@@ -2930,6 +2941,7 @@ cups_put_params(gx_device *pdev, /*
+@@ -2929,7 +2940,10 @@ cups_put_params(gx_device *pdev, /*
int xflip = 0,
yflip = 0;
int found = 0;
+-
+ gs_param_string icc_pro_dummy;
-
++ int old_cmps = cups->color_info.num_components;
++ int old_depth = cups->color_info.depth;
++
#ifdef DEBUG
dprintf2("DEBUG2: cups_put_params(%p, %p)\n", pdev, plist);
-@@ -3025,6 +3037,11 @@ cups_put_params(gx_device *pdev, /*
+ #endif /* DEBUG */
+@@ -3024,6 +3038,11 @@ cups_put_params(gx_device *pdev, /*
margins_set = param_read_float_array(plist, "Margins", &arrayval) == 0;
color_set = param_read_int(plist, "cupsColorSpace", &intval) == 0 ||
param_read_int(plist, "cupsBitsPerColor", &intval) == 0;
@@ -128,7 +132,31 @@
/* We set the old dimensions to 1 if we have a color depth change, so
that memory reallocation gets forced. This is perhaps not the correct
approach to prevent crashes like in bug 690435. We keep it for the
-@@ -4045,22 +4062,80 @@ cups_set_color_info(gx_device *pdev) /*
+@@ -3134,12 +3153,20 @@ cups_put_params(gx_device *pdev, /*
+ if ((code = gdev_prn_put_params(pdev, plist)) < 0)
+ return (code);
+
++ /* If cups_set_color_info() changed the color model of the device we want to
++ * force the raster memory to be recreated/reinitialized
++ */
++ if (cups->color_info.num_components != old_cmps || cups->color_info.depth != old_depth) {
++ width_old = 0;
++ height_old = 0;
++ }
++ else {
+ /* pdev->width/height may have been changed by the call to
+ * gdev_prn_put_params()
+ */
+- width_old = pdev->width;
+- height_old = pdev->height;
+-
++ width_old = pdev->width;
++ height_old = pdev->height;
++ }
+ /*
+ * Update margins/sizes as needed...
+ */
+@@ -4044,22 +4071,88 @@ cups_set_color_info(gx_device *pdev) /*
for (k = 0; k <= CUPS_MAX_VALUE; k ++)
cups->Density[k] = k;
}
@@ -156,12 +184,11 @@
+ {
+ default :
+ case CUPS_CSPACE_RGBW :
-+ case CUPS_CSPACE_W :
-+ case CUPS_CSPACE_WHITE :
+ case CUPS_CSPACE_RGB :
+ case CUPS_CSPACE_RGBA :
++ case CUPS_CSPACE_CMY :
++ case CUPS_CSPACE_YMC :
+# ifdef CUPS_RASTER_HAVE_COLORIMETRIC
-+ case CUPS_CSPACE_CIEXYZ :
+ case CUPS_CSPACE_CIELab :
+ case CUPS_CSPACE_ICC1 :
+ case CUPS_CSPACE_ICC2 :
@@ -179,48 +206,57 @@
+ case CUPS_CSPACE_ICCE :
+ case CUPS_CSPACE_ICCF :
+# endif /* CUPS_RASTER_HAVE_COLORIMETRIC */
-+ if (pdev->icc_struct == NULL) {
++ if (!pdev->icc_struct || (pdev->icc_struct &&
++ pdev->icc_struct->device_profile[gsDEFAULTPROFILE]->data_cs != gsRGB)) {
++
++ if (pdev->icc_struct) {
++ rc_decrement(pdev->icc_struct, "cups_set_color_info");
++ }
+ pdev->icc_struct = gsicc_new_device_profile_array(pdev->memory);
-+ }
-+ if (pdev->icc_struct->device_profile[gsDEFAULTPROFILE]) {
-+ rc_decrement(pdev->icc_struct->device_profile[gsDEFAULTPROFILE], "cups_set_color_info");
-+ pdev->icc_struct->device_profile[gsDEFAULTPROFILE] = NULL;
-+ }
-+ code = gsicc_set_device_profile(pdev, pdev->memory,
-+ (char *)DEFAULT_RGB_ICC, gsDEFAULTPROFILE);
++
++ code = gsicc_set_device_profile(pdev, pdev->memory,
++ (char *)DEFAULT_RGB_ICC, gsDEFAULTPROFILE);
++ }
+ break;
+
++ case CUPS_CSPACE_W :
++ case CUPS_CSPACE_WHITE :
+ case CUPS_CSPACE_K :
-+ if (pdev->icc_struct == NULL) {
++ case CUPS_CSPACE_GOLD :
++ case CUPS_CSPACE_SILVER :
++ if (!pdev->icc_struct || (pdev->icc_struct &&
++ pdev->icc_struct->device_profile[gsDEFAULTPROFILE]->data_cs != gsGRAY)) {
++
++ if (pdev->icc_struct) {
++ rc_decrement(pdev->icc_struct, "cups_set_color_info");
++ }
+ pdev->icc_struct = gsicc_new_device_profile_array(pdev->memory);
++
++ code = gsicc_set_device_profile(pdev, pdev->memory->non_gc_memory,
++ (char *)DEFAULT_GRAY_ICC, gsDEFAULTPROFILE);
+ }
-+ if (pdev->icc_struct->device_profile[gsDEFAULTPROFILE]) {
-+ rc_decrement(pdev->icc_struct->device_profile[gsDEFAULTPROFILE], "cups_set_color_info");
-+ pdev->icc_struct->device_profile[gsDEFAULTPROFILE] = NULL;
-+ }
-+ code = gsicc_set_device_profile(pdev, pdev->memory,
-+ (char *)DEFAULT_GRAY_ICC, gsDEFAULTPROFILE);
-+ break;
-+ case CUPS_CSPACE_GOLD :
-+ case CUPS_CSPACE_SILVER :
-+ case CUPS_CSPACE_CMY :
-+ case CUPS_CSPACE_YMC :
++ break;
+ case CUPS_CSPACE_KCMYcm :
++# ifdef CUPS_RASTER_HAVE_COLORIMETRIC
++ case CUPS_CSPACE_CIEXYZ :
++#endif
+ case CUPS_CSPACE_CMYK :
+ case CUPS_CSPACE_YMCK :
+ case CUPS_CSPACE_KCMY :
+ case CUPS_CSPACE_GMCK :
+ case CUPS_CSPACE_GMCS :
-+ if (pdev->icc_struct == NULL) {
++ if (!pdev->icc_struct || (pdev->icc_struct &&
++ pdev->icc_struct->device_profile[gsDEFAULTPROFILE]->data_cs != gsCMYK)) {
++
++ if (pdev->icc_struct) {
++ rc_decrement(pdev->icc_struct, "cups_set_color_info");
++ }
+ pdev->icc_struct = gsicc_new_device_profile_array(pdev->memory);
-+ }
-+ if (pdev->icc_struct->device_profile[gsDEFAULTPROFILE]) {
-+ rc_decrement(pdev->icc_struct->device_profile[gsDEFAULTPROFILE], "cups_set_color_info");
-+ pdev->icc_struct->device_profile[gsDEFAULTPROFILE] = NULL;
-+ }
-+ code = gsicc_set_device_profile(pdev, pdev->memory,
-+ (char *)DEFAULT_CMYK_ICC, gsDEFAULTPROFILE);
-+ break;
++
++ code = gsicc_set_device_profile(pdev, pdev->memory,
++ (char *)DEFAULT_CMYK_ICC, gsDEFAULTPROFILE);
++ }
++ break;
+ }
}
}
More information about the arch-commits
mailing list