From: Michael R Sweet Date: Wed, 2 Apr 2025 19:22:05 +0000 (-0400) Subject: Allow media to override PageSize, InputSlot, and MediaType (Issue #1125) X-Git-Tag: v2.4.12~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b46fac874434bef2d22cf9ede43cdacb367479a6;p=thirdparty%2Fcups.git Allow media to override PageSize, InputSlot, and MediaType (Issue #1125) --- diff --git a/CHANGES.md b/CHANGES.md index 22c0b98f43..f271a91b9b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,8 @@ Changes in CUPS v2.4.12 (YYYY-MM-DD) - Fixed a removal of IPP Everywhere permanent queue if installation failed (Issue #1102) - Fixed `ServerToken None` in scheduler (Issue #1111) - Fixed invalid IPP keyword values created from PPD option names (Issue #1118) +- Fixed handling of "media" and "PageSize" in the same print request + (Issue #1125) - Fixed client raster printing from macOS (Issue #1143) - Fixed the default User-Agent string. - Fixed a recursion issue in `ippReadIO`. diff --git a/cups/ppd-mark.c b/cups/ppd-mark.c index 98e94979f1..833ca5086f 100644 --- a/cups/ppd-mark.c +++ b/cups/ppd-mark.c @@ -1,7 +1,7 @@ /* * Option marking routines for CUPS. * - * Copyright © 2020-2024 by OpenPrinting. + * Copyright © 2020-2025 by OpenPrinting. * Copyright © 2007-2019 by Apple Inc. * Copyright © 1997-2007 by Easy Software Products, all rights reserved. * @@ -131,21 +131,15 @@ cupsMarkOptions( * Mark it... */ - if (!page_size || !page_size[0]) - { - if (!_cups_strncasecmp(s, "Custom.", 7) || ppdPageSize(ppd, s)) - ppd_mark_option(ppd, "PageSize", s); - else if ((ppd_keyword = _ppdCacheGetPageSize(cache, NULL, s, NULL)) != NULL) - ppd_mark_option(ppd, "PageSize", ppd_keyword); - } + if (!_cups_strncasecmp(s, "Custom.", 7) || ppdPageSize(ppd, s)) + ppd_mark_option(ppd, "PageSize", s); + else if ((ppd_keyword = _ppdCacheGetPageSize(cache, NULL, s, NULL)) != NULL) + ppd_mark_option(ppd, "PageSize", ppd_keyword); - if (cache && cache->source_option && - !cupsGetOption(cache->source_option, num_options, options) && - (ppd_keyword = _ppdCacheGetInputSlot(cache, NULL, s)) != NULL) + if (cache && cache->source_option && (ppd_keyword = _ppdCacheGetInputSlot(cache, NULL, s)) != NULL) ppd_mark_option(ppd, cache->source_option, ppd_keyword); - if (!cupsGetOption("MediaType", num_options, options) && - (ppd_keyword = _ppdCacheGetMediaType(cache, NULL, s)) != NULL) + if ((ppd_keyword = _ppdCacheGetMediaType(cache, NULL, s)) != NULL) ppd_mark_option(ppd, "MediaType", ppd_keyword); } }