Skip to content

Commit 19bba80

Browse files
committed
Mirror tolerance fix from CUPS 2.x.
1 parent fbdc483 commit 19bba80

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

tools/ippeveprinter.c

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// IPP Everywhere printer application for CUPS.
33
//
4-
// Copyright © 2021-2022 by OpenPrinting.
4+
// Copyright © 2021-2023 by OpenPrinting.
55
// Copyright © 2020 by the IEEE-ISTO Printer Working Group.
66
// Copyright © 2010-2021 by Apple Inc.
77
//
@@ -7760,11 +7760,34 @@ valid_job_attributes(
77607760

77617761
for (i = 0; i < count ; i ++)
77627762
{
7763+
int x_min, x_max; // Min/max width
7764+
int y_min, y_max; // Min/max length
7765+
77637766
size = ippGetCollection(supported, i);
77647767
x_dim = ippFindAttribute(size, "x-dimension", IPP_TAG_ZERO);
77657768
y_dim = ippFindAttribute(size, "y-dimension", IPP_TAG_ZERO);
77667769

7767-
if (ippContainsInteger(x_dim, x_value) && ippContainsInteger(y_dim, y_value))
7770+
if (ippGetValueTag(x_dim) == IPP_TAG_INTEGER)
7771+
{
7772+
x_min = ippGetInteger(x_dim, 0) - 100;
7773+
x_max = ippGetInteger(x_dim, 0) + 100;
7774+
}
7775+
else
7776+
{
7777+
x_min = ippGetRange(x_dim, 0, &x_max);
7778+
}
7779+
7780+
if (ippGetValueTag(y_dim) == IPP_TAG_INTEGER)
7781+
{
7782+
y_min = ippGetInteger(y_dim, 0) - 100;
7783+
y_max = ippGetInteger(y_dim, 0) + 100;
7784+
}
7785+
else
7786+
{
7787+
y_min = ippGetRange(y_dim, 0, &x_max);
7788+
}
7789+
7790+
if ((x_value < x_min || x_value > x_max) && (y_value < y_min || y_value > y_max))
77687791
break;
77697792
}
77707793

0 commit comments

Comments
 (0)