This bug was fixed in the package libppd - 2:2.0~rc1-0ubuntu2

---------------
libppd (2:2.0~rc1-0ubuntu2) mantic; urgency=medium

  * fix-mirrored-printout-when-ppd-has-mirrorprint-option.patch: When
    converting PPDs with “MirrorPrint” option into IPP attributes, setting
    of the option (“True”/“False”) was not considered, making printouts
    always come out mirrored (LP: #2018504).
  * fix-resolution-handling-on-ppd-to-ipp-attr-conversion.patch: For
    PPDs for driverless printers which take jobs in Apple/PWG Raster
    format always the lowest supported resolution got selected, regardless
    of the PPD default or job option settings (LP: #2022929).
  * ppdfilterpstops-fix-printers-with-reverse-output-order.patch:
    Printouts to PostScript printers (or printers with drivers which need
    PostScript input) which drop the pages face-up and therefore need to
    print in reverse order came out empty (Upstream issue #20,
    LP: #2022943).

 -- Till Kamppeter <[email protected]>  Mon,  5 Jun 2023 19:46:27
+0200

** Changed in: libppd (Ubuntu Mantic)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to libcupsfilters in Ubuntu.
https://bugs.launchpad.net/bugs/2022929

Title:
  Bugs in resolution handling, especially garbage printed when invalid
  resolution value supplied

Status in libcupsfilters package in Ubuntu:
  Fix Released
Status in libppd package in Ubuntu:
  Fix Released
Status in libcupsfilters source package in Lunar:
  New
Status in libppd source package in Lunar:
  New
Status in libcupsfilters source package in Mantic:
  Fix Released
Status in libppd source package in Mantic:
  Fix Released

Bug description:
  This bug was originally reported upstream as

      https://github.com/OpenPrinting/libcupsfilters/issues/29

  The reporter uses Fedora 38, besides Ubuntu 23.04 the second distro
  using cups-filters 2.x and libcupsfilters 2.x. As I am able to
  reproduce the bug on Ubuntu 23.04 and it is a problem many users could
  run into (it especially happens with driverless IPP printers) I post
  this bug report as base for an SRU in 23.04.

  What happens is that if a job is printed and along with it a
  resolution setting is supplied which is not supported by the printer,
  garbage is printed as the job gets actually rasterized with the wrong
  resolution. This was discovered by the Chromium Browser sending print
  jobs with `-o resolution=96dpi` regardless which resolutions the
  printer actually supports. Most driverless printers receive their jobs
  rasterrized into Apple Raster or PWG Raster and so for them this bug
  occurs.

  I have already fixed the bug upstream in libcupsfilters via

      https://github.com/OpenPrinting/libcupsfilters/commit/2892e9a63

  The fix makes the function cfIPPAttrResolutionForPrinter() used more
  intensely, in which another bug showed, the list of supported
  resolutions searched for as a range data type which was wrong and so
  the list not being found. So I fixed this here, also in
  libcupsfilters:

      https://github.com/OpenPrinting/libcupsfilters/commit/9ff1341c2

  Now unsupported resolutions supplied to jobs are ignored so that the
  default resolution gets used then.

  The bug masked another bug in resolution handling which got revealed
  once the above-mentioned fix was applied.Here the problem is that for
  driverless IPP printers, printing in Apple Raster or PWG Raster always
  the minimum resolution got used, even if I higher one was requested,
  as the default resolution or by a job attribute/option which sets a
  higher resolution. This I fixed in libppd via:

      https://github.com/OpenPrinting/libppd/commit/e2190988ff6c1

  Now always the correct resolution gets used for the rasterization of
  the job and so the correct print quality obtained.

  The fixes get applied to the libcupsfilters and libppd source packages
  both in Mantic and in Lunar (SRU).

  [ Impact ]

  The bug impacts at least all users of driverless IPP printers which
  take print jobs in raster formats, and these are most common printers
  nowadays. Probably also other printers are affected.

  The principal bug, jobs with unsupported resolution settings being
  accepted leads to unusable printouts wasting paper and toner/ink.

  The secondary problem of always the lowest supported resolution being
  used leads to a lower print quality than expected.

  The fact that the Chromium Browser from version 112 on (we use the
  Snap and current version there is 113) sens "-o resolution=96dpi"
  along with jobs will trigger this bug for many people.

  [ Test Plan ]

  Download the attached sample PPD file, a file to use the HP OfficeJet
  Pro 8730 in driverless mode, sending the job data in Apple Raster.
  Also have a PDF file handy.

  No printer is required for the tests, simply observe the log output on
  the terminsl, the resolution used in the Ghostscript command line (the
  actual rasterization is done by Ghostscript).

  cupsfilter -P driverless.ppd -m image/urf -o printer-resolution=96dpi
  file.pdf > out

  The terminal output contains a line like

  DEBUG: cfFilterGhostscript: Ghostscript command line: gs -dQUIET
  -dSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -dNOMEDIAATTRS
  -dUsePDFX3Profile -sstdout=%stderr -sOutputFile=%stdout
  -sDEVICE=appleraster -sOutputType=automatic -r96x96
  -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -dcupsBitsPerColor=8
  -dcupsColorOrder=0 -dcupsColorSpace=19
  -dcupsBorderlessScalingFactor=0.0000 -dcupsInteger1=1 -dcupsInteger2=1
  -scupsRenderingIntent=auto -scupsPageSizeName=A4 -dcupsManualCopies
  -I/usr/share/cups/fonts -sOutputICCProfile=srgb.icc -c -f -_

  Note the "-r96x96" showing that the unsupported resolution got
  accepted for the rasterisation.

  With the SRU applied we get "-r600x600" so the rasterisation is done
  with the default resolution of 600 dpi.

  To reproduce the secondary problem of always the lowest resolution be
  used run

  cupsfilter -P driverless.ppd -m image/urf file.pdf > out

  Here you will get "-r300x300" despite the default resolution specified
  in the PPD file is 600 dpi ("*DefaultResolution: 600 dpi" in the PPD
  file). After applying the SRU you get the expected "-r600x600".

  You get also the correct resolution according to the requested print
  quality:

  cupsfilter -P driverless.ppd -m image/urf -o cupsPrintQuality=draft
  file.pdf > out

  gives "-r300x300" after applying the SRU and

  cupsfilter -P driverless.ppd -m image/urf -o cupsPrintQuality=normal
  file.pdf > out

  and

  cupsfilter -P driverless.ppd -m image/urf -o cupsPrintQuality=high
  file.pdf > out

  both give "-r600x600" after applying the SRU.

  You can also verify the resolution of the Apple Raster file "out" by
  installing rasterview

  sudo snap install rasterview

  and opening the file and see its metadata:

  rasterview out

  [ Where problems could occur ]

  As the patches are rather small and the changes relatively easy to
  understand the potential for a regression is low but naturally not
  100% excluded.

  At least no complex changes in handling dynamic memory are contained,
  so the chance of having introduced a crasher is extremely low.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libcupsfilters/+bug/2022929/+subscriptions


-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to