Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 884713 - net-print/hplip: no grayscale printing with ColorLaserJet MFP M278-M281 (hp-color_laserjet_mfp_m278-m281-ps.ppd defective)
Summary: net-print/hplip: no grayscale printing with ColorLaserJet MFP M278-M281 (hp-c...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major
Assignee: Daniel Pielmeier
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2022-12-07 15:44 UTC by riepernet
Modified: 2025-05-04 15:17 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
working ppd from Opensuse (hp-color_laserjet_mfp_m278-m281-ps.ppd,106.55 KB, text/plain)
2022-12-07 15:44 UTC, riepernet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description riepernet 2022-12-07 15:44:29 UTC
Created attachment 840647 [details]
working ppd from Opensuse

Even though I switch to grayscale printing, the page is printed in color anyway.
The hp-color_laserjet_mfp_m278-m281-ps.ppd file seems to be faulty as described in the bug report for arch: https://bugs.archlinux.org/task/73158

"
A notable difference, in fact the one that breaks my workflow is that the *HPPJLColorAsGray strings are both "%%" either for the True and the False case in the arch version of the file, while in ubuntu the string for the True case is a PJL command "@PJL SET GRAYSCALE=COMPOSITE<0A>"
"

workaround:
I loaded the ppd from 'OpenSuSE Leap 15.3 for x86_64' (hplip-3.20.11-2.1.x86_64.rpm) and am now able to switch between color and black.

Due to the high costs of cymk-cartridges I've chosen major serverity.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-07 15:49:44 UTC
(I'll add 'PATCH' as a keyword as it's close enough.)
Comment 2 tomtom69 2025-05-02 19:14:53 UTC
I can confirm replacing the file helps.
However this (still) needs to be done after every rebuild and cannot be done automatically. It can also not be included in binpkgs so I have to manually roll out on all binpkg clients.
I tried to understand the ebuild but I did not succeed in understanding how these files are generated during compiling and why gentoo builds have the bug and ubuntu builds do not.
Any clue why the strings are generated wrongly on gentoo builds?
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-02 20:31:38 UTC
(In reply to tomtom69 from comment #2)
> I tried to understand the ebuild but I did not succeed in understanding how
> these files are generated during compiling and why gentoo builds have the
> bug and ubuntu builds do not.

I guess it's really https://bugs.archlinux.org/task/73158.html#comment205913, i.e. Ubuntu seem to go out of their way to *not* use the ones that upstream ship...

I'll look a little bit more (but I don't know much about PPDs, I'm just curious).
Comment 4 tomtom69 2025-05-03 12:06:32 UTC
I found out a little more:
The .ppd.gz files are present in the original package tarball, they are not generated at compile time.
Bisecting the archives of hplip I found out that the change of the ppd file was introduced with version 3.21.8. The ppd file of 3.21.6 matches the current ubuntu version (besides one white space), so I assume Ubuntu packaging uses the old .ppd file from <=3.21.6, while most of the others just use the "official" release tarball.
Gentoo stable switched from to 3.20.11 to 3.22.2 (regarding my emerge.log) so we saw this issue not that early.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-04 05:04:55 UTC
In https://launchpad.net/ubuntu/+source/hplip/+changelog, I see:

"""

3.23.12+dfsg0-0ubuntu1
Superseded in noble-proposed on 2024-03-13

hplip (3.23.12+dfsg0-0ubuntu1) noble; urgency=low

  * Update to new upstream version 3.23.12+dfsg0
  * Manually updated patches:
    - 0005-Cope-with-prnt-hpcups-ErnieFilter.-cpp-h-removal-by-.patch
    - 0020-In-hp-scan-s-manpage-sort-PAGE_SIZES-in-help-for-the.patch
    - 0029-Call-QMessageBox-constructors-of-PyQT5-with-the-corr.patch
    - 0034-Fix-some-typos-in-BUG-and-DBG-messages.patch
    - 0064-Fix-AttributeError-when-connecting-to-printer-via-wi.patch
    - 0069-Fixing-issues-found-by-coverity-scan.patch
    - 0074-py3.8-Fix-SyntaxWarning-is-is-not-with-a-literal.patch
  * Removed patch:
    - 0083-add-format-string-to-snprintf.patch
  * Refreshed some of the other patches.
  * 0084-Replace-readfp-by-read-file.patch: In Python's configparser
    module readfp() is replaced by read_file().
  * 0085-Fix-hp-color-laserjet-mfp-e78635-ps-ppd.patch: Fixed broken
    PostScript PPD file for HP Color LaserJet MFP E78635. <--- this
  * Install new hpcdmfax filter.
  * Merge from Debian unstable. Remaining changes:
    - Lower the python3-reportlab depends to a suggests to not have to MIR
      python-rlpycairo now, reportlab is only needed for unused fax utils.

 -- Till Kamppeter <email address hidden>  Tue, 27 Feb 2024 14:46:08 +0100
"""
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-04 05:06:42 UTC
(In reply to Sam James from comment #6)
> Ubuntu have both:
> *
> https://git.launchpad.net/ubuntu/+source/hplip/tree/debian/patches/0022-
> LaserJet-PostScript-4000-PPD-bugfix.patch
> *
> https://git.launchpad.net/ubuntu/+source/hplip/tree/debian/patches/0085-Fix-
> hp-color-laserjet-mfp-e78635-ps-ppd.patch

... and

* https://git.launchpad.net/ubuntu/+source/hplip/tree/debian/patches/0001-models.dat-Fix-scanning-with-M281fdw-LaserJet.patch
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-04 05:13:38 UTC
(In reply to tomtom69 from comment #4)

It looks like Ubuntu might be using whatever is in the hplip git repo, and it's different in the hplip release tarballs?
Comment 9 tomtom69 2025-05-04 15:17:01 UTC
The patch for models.dat includes a plugin. Afaik this is needed for the scanner module. I have net-print/hplip-plugin installed in order to be able to use the scanner, and it works even with current version w/o the patch.
Possibly ubuntu does not use the tarballs, but I could not find a repository for hplip. For me it looks like this repo is proprietary of HP and not publically available.