Skip to content

Commit

Permalink
raster.c: Always use sRGB/sGray if driver is PWG/URF and RGB/Gray is …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
zdohnal authored Mar 7, 2024
1 parent 48ff575 commit 78cc675
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cupsfilters/raster.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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"))
Expand Down

0 comments on commit 78cc675

Please sign in to comment.