]> git.ipfire.org Git - thirdparty/cups-filters.git/commit
libppd: Improved caching of PPD's page sizes and custom page size limits
authorTill Kamppeter <till.kamppeter@gmail.com>
Wed, 22 Sep 2021 10:24:24 +0000 (12:24 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Wed, 22 Sep 2021 10:24:24 +0000 (12:24 +0200)
commit977fa9134be82da401b2e529934b7bc7c86ddd39
treeab17674b5a884e231763fbacb28adfd5d3be80ab
parent784b7741dbfa48bb35aa6b5f78c6db52f1b46d0c
libppd: Improved caching of PPD's page sizes and custom page size limits

1. If an PPD page size has non-standard dimensions, pwgMediaForSize()
returns "custom_WIDTHxHEIGHTuu_WIDTHxHEIGHTuu" and not NULL, while we
assume that we would get NULL in such a case. So consider "custom_..."
PWG page size names also as a PWG size not having been found. This
gives PWG page size nmaes of "pp_lowerppd_WIDTHxHEIGHTuu" style, much
more useful and the page size not being skipped by PAPPL's web
interface.

2. If the PPD defines a too high demension (something like ~30 m is
enough) for the maximum allowed custom page size, the generated PWG
page size name ("custom_max_WIDTHxHEIGHTuu") contains negative numbers
due to an integer overflow. If this happens, we sanitize the string
now replacing these negative numbers by a high integer value (10000
inches or 100000 mm). This PWG size name is used by PAPPL's web
interface to know about the allowed dimensions for a custom page
size. With a negative value the web interface inserts 0, making the
max dimension smaller than the min and with this clicks on the "Save
Changes" button on the "Media" web interface page of PAPPL are
silently ignored.
ppd/ppd-cache.c