]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Allow media to override PageSize, InputSlot, and MediaType (Issue #1125)
authorMichael R Sweet <msweet@msweet.org>
Wed, 2 Apr 2025 19:22:05 +0000 (15:22 -0400)
committerMichael R Sweet <msweet@msweet.org>
Wed, 2 Apr 2025 19:22:05 +0000 (15:22 -0400)
CHANGES.md
cups/ppd-mark.c

index 22c0b98f432a49411d277785a7fde3d96d01d20b..f271a91b9b88e38390a74e7001e347510553c67c 100644 (file)
@@ -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`.
index 98e94979f1f9b33a4e7c490d13911f6bad542110..833ca5086f1f1c76bd4d27807d2808431998e1dd 100644 (file)
@@ -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);
     }
   }