]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Don't use custom prefix for non-standard sizes - use oe or om (Issue #1388)
authorMichael R Sweet <msweet@msweet.org>
Wed, 12 Nov 2025 18:53:36 +0000 (13:53 -0500)
committerMichael R Sweet <msweet@msweet.org>
Wed, 12 Nov 2025 18:53:36 +0000 (13:53 -0500)
cups/ppd-cache.c
cups/ppd-private.h
cups/pwg-media.c

index 4f88892e64a0b9d372937c453e1c29bfa019cd22..a5fce7808a9c82fea603b5f2b17abb10c8e6c12b 100644 (file)
@@ -2852,13 +2852,13 @@ _ppdCacheGetSize(
       return (NULL);
     }
 
+    pwgFormatSizeName(pc->custom_pwg_size, sizeof(pc->custom_pwg_size), "custom", /*name*/NULL, (int)w, (int)l, /*units*/NULL);
+
     pc->custom_size.map.ppd = (char *)page_size;
+    pc->custom_size.map.pwg = pc->custom_pwg_size;
     pc->custom_size.width   = (int)w;
     pc->custom_size.length  = (int)l;
 
-    if ((media = pwgMediaForSize((int)w, (int)l)) != NULL)
-      pc->custom_size.map.pwg = (char *)media->pwg;
-
     return (&(pc->custom_size));
   }
 
index 2a0e7783594bfc1d74cf3b38ff5dbd883f16798c..4d289b1792d6dbad25daf2bded1fe71dbf923b53 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Private PPD definitions 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.
  *
@@ -109,7 +109,8 @@ struct _ppd_cache_s                 /**** PPD cache and PWG conversion data ****/
                custom_min_length;      /* Minimum custom length in 2540ths */
   char         *custom_max_keyword,    /* Maximum custom size PWG keyword */
                *custom_min_keyword,    /* Minimum custom size PWG keyword */
-               custom_ppd_size[41];    /* Custom PPD size name */
+               custom_ppd_size[41],    /* Custom PPD size name */
+               custom_pwg_size[128];   /* Custom PWG size name */
   pwg_size_t   custom_size;            /* Custom size record */
   char         *source_option;         /* PPD option for media source */
   int          num_sources;            /* Number of media sources */
index a2b49169b1bea3e8543395101207ceca27180a6b..bfa192354ebb1e1910b79fd979af673b4700b80e 100644 (file)
@@ -1021,11 +1021,11 @@ _pwgMediaNearSize(pwg_media_t *pwg,     /* I - Media buffer */
  /*
   * Not a standard size; convert it to a PWG custom name of the form:
   *
-  *     custom_WIDTHxHEIGHTuu_WIDTHxHEIGHTuu
+  *     [oe|om]_WIDTHxHEIGHTuu_WIDTHxHEIGHTuu
   */
 
   if (keyword)
-    pwgFormatSizeName(keyword, keysize, "custom", NULL, width, length, NULL);
+    pwgFormatSizeName(keyword, keysize, /*prefix*/NULL, NULL, width, length, NULL);
 
   if (ppdname)
   {