Repository navigation
Map print-color-mode=monochrome for PPDs with ColorModel "Grayscale" - #1816
Closed
rogercrocha wants to merge 1 commit into
Closed
rogercrocha wants to merge 1 commit into
rogercrocha wants to merge 1 commit into
Conversation
Foomatic PPDs name the gray choice of ColorModel "Grayscale". It was not in the list of option/choice pairs used to auto-create grayscale presets when a PPD has no APPrinterPreset, so print-color-mode=monochrome was advertised but ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013UYJc7DdqftdvopskQ2BoK
Member
|
Closing as won't fix - Foomatic driver needs to use the keywords that were defined 37 years ago... Also, in the future if you have an issue with a fix already, please just file a PR since a bug + a PR is double the work for everyone. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes OpenPrinting/cups-filters#801
When a PPD has no
*APPrinterPreset,_ppdCacheCreateWithPPD()builds the grayscale presets from a short list of known option/choice pairs. Foomatic PPDs (thepxlcolor/pxldpldrivers and several hundred color PPDs shipped in foomatic-db) name the gray choice ofColorModelGrayscale, which is not in the list, soprint-color-mode=monochromeis advertised but ignored and jobs print in color.This adds
ColorModel=Grayscaleto the list, right afterColorModel=Gray, using the same mechanism as the existing entries. No other behavior changes.Tested on master with a small program calling
_ppdCacheCreateWithPPD()on the generatedBrother-HL-4050CDN-pxlcolorPPD:monochrome/normal=ColorModel=GrayscaleThe same mapping, done with
*APPrinterPreseton CUPS 2.4.10, makes the job print in grayscale (foomatic-ripruns Ghostscript with-sDEVICE=pxlmonoinstead ofpxlcolor).No cache version bump is included:
_PPD_CACHE_VERSIONon master is already newer than in 2.4.x, so existing cache files are regenerated on upgrade. If you want this in 2.4.x too, the backport would need a bump there.AI disclosure: this change and its description were prepared with the help of AI (Claude, by Anthropic). The bug was reproduced on my own setup and the change was tested as described above.
🤖 Generated with Claude Code
https://claude.ai/code/session_013UYJc7DdqftdvopskQ2BoK