- Fixed unreachable block in IPP backend (Issue #1351)
- Fixed memory leak in `_cupsConvertOptions()` (Issue #1354)
- Fixed missing write check in `cupsFileOpen/Fd` (Issue #1360)
+- Fixed mapping of standard PPD/PWG/legacy media size names to the local PPD
+ size name (Issue #1375)
- Fixed error recovery when scanning for PPDs in `cups-driverd` (Issue #1416)
- Fixed allowed values for directive `FilterNice`
- Fixed an allocation bug in the `rastertoepson` filter (Issue #1537)
/*
* Option marking routines for CUPS.
*
- * Copyright © 2020-2025 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
* Copyright © 2007-2019 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
cupsArraySave(ppd->options);
+ if (!_cups_strcasecmp(option, "media") || !_cups_strcasecmp(option, "media-col"))
+ option = "PageSize";
+
o = ppdFindOption(ppd, option);
cupsArrayRestore(ppd->options);
if ((c = ppdFindChoice(o, "Custom")) == NULL)
return;
- if (!_cups_strcasecmp(option, "PageSize"))
+ if (!_cups_strcasecmp(option, "PageRegion") || !_cups_strcasecmp(option, "PageSize"))
{
/*
* Handle custom page sizes...
choice = "Custom";
}
+ else if (!_cups_strcasecmp(option, "PageRegion") || !_cups_strcasecmp(option, "PageSize"))
+ {
+ /*
+ * Handle page sizes as PPD, legacy, or PWG names...
+ */
+
+ ppd_size_t *ppdsize; /* PPD size */
+
+ if ((ppdsize = ppdPageSize(ppd, choice)) == NULL)
+ {
+ /*
+ * Not a PPD size name, look it up...
+ */
+
+ const char *pagesize; /* PPD PageSize choice */
+
+ if ((pagesize = _ppdCacheGetPageSize(ppd->cache, /*job*/NULL, choice, /*exact*/NULL)) != NULL)
+ ppdsize = ppdPageSize(ppd, pagesize);
+ }
+
+ if (!ppdsize)
+ return;
+
+ choice = ppdsize->name;
+
+ if ((c = ppdFindChoice(o, choice)) == NULL)
+ return;
+ }
else if (choice[0] == '{')
{
/*