Skip to content

Commit b46fac8

Browse files
committed
Allow media to override PageSize, InputSlot, and MediaType (Issue #1125)
1 parent c0b8e48 commit b46fac8

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Changes in CUPS v2.4.12 (YYYY-MM-DD)
1212
- Fixed a removal of IPP Everywhere permanent queue if installation failed (Issue #1102)
1313
- Fixed `ServerToken None` in scheduler (Issue #1111)
1414
- Fixed invalid IPP keyword values created from PPD option names (Issue #1118)
15+
- Fixed handling of "media" and "PageSize" in the same print request
16+
(Issue #1125)
1517
- Fixed client raster printing from macOS (Issue #1143)
1618
- Fixed the default User-Agent string.
1719
- Fixed a recursion issue in `ippReadIO`.

cups/ppd-mark.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Option marking routines for CUPS.
33
*
4-
* Copyright © 2020-2024 by OpenPrinting.
4+
* Copyright © 2020-2025 by OpenPrinting.
55
* Copyright © 2007-2019 by Apple Inc.
66
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
77
*
@@ -131,21 +131,15 @@ cupsMarkOptions(
131131
* Mark it...
132132
*/
133133

134-
if (!page_size || !page_size[0])
135-
{
136-
if (!_cups_strncasecmp(s, "Custom.", 7) || ppdPageSize(ppd, s))
137-
ppd_mark_option(ppd, "PageSize", s);
138-
else if ((ppd_keyword = _ppdCacheGetPageSize(cache, NULL, s, NULL)) != NULL)
139-
ppd_mark_option(ppd, "PageSize", ppd_keyword);
140-
}
134+
if (!_cups_strncasecmp(s, "Custom.", 7) || ppdPageSize(ppd, s))
135+
ppd_mark_option(ppd, "PageSize", s);
136+
else if ((ppd_keyword = _ppdCacheGetPageSize(cache, NULL, s, NULL)) != NULL)
137+
ppd_mark_option(ppd, "PageSize", ppd_keyword);
141138

142-
if (cache && cache->source_option &&
143-
!cupsGetOption(cache->source_option, num_options, options) &&
144-
(ppd_keyword = _ppdCacheGetInputSlot(cache, NULL, s)) != NULL)
139+
if (cache && cache->source_option && (ppd_keyword = _ppdCacheGetInputSlot(cache, NULL, s)) != NULL)
145140
ppd_mark_option(ppd, cache->source_option, ppd_keyword);
146141

147-
if (!cupsGetOption("MediaType", num_options, options) &&
148-
(ppd_keyword = _ppdCacheGetMediaType(cache, NULL, s)) != NULL)
142+
if ((ppd_keyword = _ppdCacheGetMediaType(cache, NULL, s)) != NULL)
149143
ppd_mark_option(ppd, "MediaType", ppd_keyword);
150144
}
151145
}

0 commit comments

Comments
 (0)