diff options
Diffstat (limited to 'net-print/libcupsfilters/files/libcupsfilters-2.0.0-raster-gray.patch')
-rw-r--r-- | net-print/libcupsfilters/files/libcupsfilters-2.0.0-raster-gray.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/net-print/libcupsfilters/files/libcupsfilters-2.0.0-raster-gray.patch b/net-print/libcupsfilters/files/libcupsfilters-2.0.0-raster-gray.patch new file mode 100644 index 000000000000..e1648c041e97 --- /dev/null +++ b/net-print/libcupsfilters/files/libcupsfilters-2.0.0-raster-gray.patch @@ -0,0 +1,50 @@ +https://bugs.gentoo.org/927137 +https://github.com/OpenPrinting/cups-filters/issues/578 +https://github.com/OpenPrinting/libcupsfilters/commit/78cc6758d98c31397c8addefaa3dfd8746331b72 + +From 78cc6758d98c31397c8addefaa3dfd8746331b72 Mon Sep 17 00:00:00 2001 +From: zdohnal <zdohnal@redhat.com> +Date: Thu, 7 Mar 2024 18:27:06 +0100 +Subject: [PATCH] raster.c: Always use sRGB/sGray if driver is PWG/URF and + RGB/Gray is requested (#51) + +Some driverless printers (EPSON L3160 in Fedora report) stopped working +after commit c6175a2 if `ColorModel=RGB` is passed as option. A +different CUPS color space is assigned with the fix - CUPS_CSPACE_RGB, +which results in no ICC profile being assigned into Ghostscript command +line. + +Probably we can try other .icc profiles with CUPS_CSPACE_RGB (srgb.icc +does not work with RGB color space), but I tested with reporter that +using sRGB space + srgb.icc works for the printer - so the patch is to +use sRGB if the driver is URF/PWG. + +Same logic applied for grayscale printing, if Gray is requested, sGray is +used for URF/PWG. +--- + cupsfilters/raster.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/cupsfilters/raster.c b/cupsfilters/raster.c +index e9a8ad1f..7b62b922 100644 +--- a/cupsfilters/raster.c ++++ b/cupsfilters/raster.c +@@ -1550,7 +1550,7 @@ raster_base_header(cups_page_header_t *h, // O - Raster header + { + if (*(val + 4) == '_' || *(val + 4) == '-') + ptr = val + 5; +- colorspace = 18; ++ colorspace = pwg_raster ? 18 : 3; + numcolors = 1; + } + else if (is_color && !strncasecmp(val, "Srgb", 4)) +@@ -1571,7 +1571,7 @@ raster_base_header(cups_page_header_t *h, // O - Raster header + { + if (*(val + 3) == '_' || *(val + 3) == '-') + ptr = val + 4; +- colorspace = 1; ++ colorspace = pwg_raster ? 19 : 1; + numcolors = 3; + } + else if (!strcasecmp(val, "auto")) + |