[Pkg-cups-devel] Bug#468049: cupsys: should pdftops wrapper round up paper dimensions?

Sanjoy Mahajan sanjoy at MIT.EDU
Tue Feb 26 19:18:14 UTC 2008


Package: cupsys
Version: 1.3.5-2
Severity: minor
File: /usr/lib/cups/filter/pdftops

The filter/pdftops.c generated by
debian/patches/pdftops-cups-1.4.dpatch rounds down when computing the
paper width and height.  

Although I didn't make a test case to show that this operation causes
a problem, it worries me.  To avoid clipping, shouldn't it round up?
If so, here's a diff:

--- pdftops.c.orig	2008-02-26 14:03:40.000000000 -0500
+++ pdftops.c	2008-02-26 14:11:49.000000000 -0500
@@ -23,6 +23,7 @@
  * Include necessary headers...
  */
 
+#include <math.h>
 #include <cups/cups.h>
 #include <cups/string.h>
 #include <cups/i18n.h>
@@ -211,13 +212,13 @@
 
       if (orientation & 1)
       {
-	snprintf(pdfwidth, sizeof(pdfwidth), "%d", (int)(size->length));
-	snprintf(pdfheight, sizeof(pdfheight), "%d", (int)(size->width));
+	snprintf(pdfwidth, sizeof(pdfwidth), "%d", (int) ceil(size->length));
+	snprintf(pdfheight, sizeof(pdfheight), "%d", (int) ceil(size->width));
       }
       else
       {
-	snprintf(pdfwidth, sizeof(pdfwidth), "%d", (int)(size->width));
-		 snprintf(pdfheight, sizeof(pdfheight), "%d", (int)(size->length));
+	snprintf(pdfwidth, sizeof(pdfwidth), "%d", (int) ceil(size->width));
+	snprintf(pdfheight, sizeof(pdfheight), "%d", (int) ceil(size->length));
       }
 
       pdfargv[pdfargc++] = (char *)"-paperw";

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages cupsys depends on:
ii  adduser               3.105              add and remove users and groups
ii  cupsys-common         1.3.5-2            Common UNIX Printing System(tm) - 
ii  debconf [debconf-2.0] 1.5.19             Debian configuration management sy
ii  ghostscript [gs-esp]  8.61.dfsg.1-1      The GPL Ghostscript PostScript/PDF
ii  libavahi-compat-libdn 0.6.22-2           Avahi Apple Bonjour compatibility 
ii  libc6                 2.7-8              GNU C Library: Shared libraries
ii  libcupsimage2         1.3.5-2            Common UNIX Printing System(tm) - 
ii  libcupsys2            1.3.5-2            Common UNIX Printing System(tm) - 
ii  libdbus-1-3           1.1.4-1            simple interprocess messaging syst
ii  libgnutls26           2.2.2-1            the GNU TLS library - runtime libr
ii  libkrb53              1.6.dfsg.3~beta1-3 MIT Kerberos runtime libraries
ii  libldap-2.4-2         2.4.7-5            OpenLDAP libraries
ii  libpam0g              0.99.7.1-5         Pluggable Authentication Modules l
ii  libpaper1             1.1.23             library for handling paper charact
ii  libslp1               1.2.1-7.1          OpenSLP libraries
ii  lsb-base              3.1-24             Linux Standard Base 3.1 init scrip
ii  perl-modules          5.8.8-12           Core Perl modules
ii  poppler-utils [xpdf-u 0.6.4-1            PDF utilitites (based on libpopple
ii  procps                1:3.2.7-6          /proc file system utilities
ii  ssl-cert              1.0.16             simple debconf wrapper for OpenSSL

Versions of packages cupsys recommends:
ii  avahi-utils             0.6.22-2         Avahi browsing, publishing and dis
ii  cupsys-client           1.3.5-2          Common UNIX Printing System(tm) - 
ii  foomatic-filters        3.0.2-20080211-2 OpenPrinting printer support - fil
ii  smbclient               3.0.28-2+b1      a LanManager-like simple client fo

-- debconf information:
  cupsys/raw-print: true
  cupsys/backend: ipp, lpd, parallel, scsi, serial, socket, usb, snmp, dnssd





More information about the Pkg-cups-devel mailing list