]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Media size matching now uses a tolerance of 0.5mm (rdar://33822024)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 21 Feb 2019 17:46:09 +0000 (12:46 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 21 Feb 2019 17:46:09 +0000 (12:46 -0500)
CHANGES.md
cups/pwg-media.c

index 7a9c1350eafeed2790c6864363d843fa1634ca7d..234dc5a9cdaeb211969134f81248bdfdc2498021 100644 (file)
@@ -27,6 +27,7 @@ Changes in CUPS v2.2.11
 - Added a USB quirks rule for Xerox printers (Issue #5523)
 - The scheduler's self-signed certificate did not include all of the alternate
   names for the server when using GNU TLS (Issue #5525)
+- Media size matching now uses a tolerance of 0.5mm (rdar://33822024)
 - The lpadmin command would hang with a bad PPD file (rdar://41495016)
 - Fixed a potential crash bug in cups-driverd (rdar://46625579)
 - Fixed a performance regression with large PPDs (rdar://47040759)
index 62455ea6dfad82c70585f1d64fd8b9351310389c..0c6e44bc346efa29cea02d81eee8579dfc940f4d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PWG media name API implementation for CUPS.
  *
- * Copyright 2009-2017 by Apple Inc.
+ * Copyright 2009-2019 by Apple Inc.
  *
  * These coded instructions, statements, and computer programs are the
  * property of Apple Inc. and are protected by Federal copyright
@@ -26,6 +26,7 @@
 
 #define _PWG_MEDIA_IN(p,l,a,x,y) {p, l, a, (int)(x * 2540), (int)(y * 2540)}
 #define _PWG_MEDIA_MM(p,l,a,x,y) {p, l, a, (int)(x * 100), (int)(y * 100)}
+#define _PWG_EPSILON   50              /* Matching tolerance */
 
 
 /*
@@ -912,10 +913,11 @@ pwgMediaForSize(int width,                /* I - Width in hundredths of millimeters */
 {
  /*
   * Adobe uses a size matching algorithm with an epsilon of 5 points, which
-  * is just about 176/2540ths...
+  * is just about 176/2540ths...  But a lot of international media sizes are
+  * very close so use 0.5mm (50/2540ths) as the maximum delta.
   */
 
-  return (_pwgMediaNearSize(width, length, 176));
+  return (_pwgMediaNearSize(width, length, _PWG_EPSILON));
 }