Bug 226863 - print/gutenprint: cups-genppd chokes on paper strings
Summary: print/gutenprint: cups-genppd chokes on paper strings
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Christoph Moench-Tegeder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-23 03:32 UTC by freebsd
Modified: 2018-03-24 23:34 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description freebsd 2018-03-23 03:32:55 UTC
# cups-genppd.5.2 "Epson Stylus Pro 3880"
Gutenprint: bad string 6.25x9TopFoldCard (4.5x6.25 Top Fold Card (6.25x9))
Gutenprint: bad string 5.5x8.5TopFoldCard (4.25x5.5 Top Fold Card (5.5x8.5))
Gutenprint: bad string 8.5x11TopFoldCard (5.5x8.5 Top Fold Card (8.5x11))
Gutenprint: bad string 5.25x10.5TopFoldCard (5.25x5.25 Top Fold Card (5.25x10.5))

The errors are generated many times..
The ppd file looks like it is generated ok; the papers are still listed.

I believe it is related to the decimal point in the name;
at line 395 in the generated ppd:

*PageRegion 6.25x9TopFoldCard/4.5x6.25 Top Fold Card (6.25x9):  "<</PageSize[450 648]/ImagingBBox null>>setpagedevice"

Note that similar entries without the decimal cause no errors:

*PageRegion 6x8TopFoldCard/4x6 Top Fold Card (6x8):     "<</PageSize[432 576]/ImagingBBox null>>setpagedevice"
Comment 1 Christoph Moench-Tegeder freebsd_committer freebsd_triage 2018-03-24 14:11:06 UTC
related: bug #214304
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-03-24 15:32:22 UTC
A commit references this bug:

Author: cmt
Date: Sat Mar 24 15:31:41 UTC 2018
New revision: 465457
URL: https://svnweb.freebsd.org/changeset/ports/465457

Log:
  gutenprint: fixes around genppd

   * in papers.xml, rename "Greeting Card" paper format names to not contain
     decimal points ("."), as gutenprint's internal list handling rejects
     points in element names. I guess these paper formats never really
     worked, but I can't really test this for lack of a supported printer.
   * create symlink cups-genppd to cups.genppd.5.2 to match documentation.

  PR:		226863 226865
  Reported by:	freebsd dreamchaser org

Changes:
  head/print/gutenprint/Makefile
  head/print/gutenprint/files/patch-src_xml_papers.xml
  head/print/gutenprint/pkg-plist
Comment 3 Christoph Moench-Tegeder freebsd_committer freebsd_triage 2018-03-24 15:38:37 UTC
That's a funny one. Paper names are declared as xsd:normalizedString, but the list handling in gutenprint imposes additional restrictions (i.e. no decimal points) on list element names. This restriction may be arbitrary, or have some deeper meaning in the internal workings of printers, PPDs and gutenprint (which I couldn't find on a quick glance).
As there's quite a chance that these paper formats never have worked, I just renamed them transforming the point to an underscore.

Thanks for the report.
Comment 4 freebsd 2018-03-24 22:09:30 UTC
I have been using these paper names for several years in the gimp-gutenprint plugin, and I am using them now in the version which caused this bug to be generated.  I just printed one using
  5.5x8.5TopFoldCard (4.25x5.5 Top Fold Card (5.5x8.5))
Comment 5 freebsd 2018-03-24 23:34:13 UTC
By the above I mean I have been using locally modified .ppd files which contained these names with gimp-gutenprint.  As I recently upgraded my ports, and the old files have been renamed *_unused, I am assuming gimp-gutenprint is using whatever it has internally, so it still works

$ pkg info -l gimp-gutenprint 
gimp-gutenprint-5.2.13:
        /usr/local/lib/libgutenprintui2.so
        /usr/local/lib/libgutenprintui2.so.1
        /usr/local/lib/libgutenprintui2.so.1.0.0
        /usr/local/libdata/pkgconfig/gutenprintui2.pc
        /usr/local/libexec/gimp/2.2/plug-ins/gutenprint
        /usr/local/share/licenses/gimp-gutenprint-5.2.13/GPLv2
        /usr/local/share/licenses/gimp-gutenprint-5.2.13/LICENSE
        /usr/local/share/licenses/gimp-gutenprint-5.2.13/catalog.mk

I cannot confirm whether or not cups has problems with these, as I am currently having problems getting cups to connect to any printer.  With previous versions of cups I used these same ppd files, but did not use those paper names via cups -- only via gimp-gutenprint.