OpenPrinting / system-config-printer

Graphical user interface for CUPS administration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does the user have access to the imageto... filters via system-config-printer ?

Golddouble opened this issue · comments

brightness,saturation,gamma

Are the settings "brightness, gamma, and saturation" we can change via system-config-printer options from one of the following filters?:

-imagetobrf
-imagetopdf
-imagetops
-imagetoraster
-imagetoubrl

?

Thank you.

I assume that this is the case. To check you can set these values and then put CUPS into debug mode via

cupsctl --debug-logging

After that you print a job. Then look in /var/log/cups/error_log for the logging of the job (lines with [Job XXX] where XXX is the number of the job (as displayed by lpstat -o). Look whether somewhere brightmess, gamma, saturation is mentioned and whether it reflects the values which you have set. If so, said filters will pick up and apply these values.

If the user sets brightness, gamma or saturation in 'Job options' they will appear at argv[5] for job log:

Mar 15 16:22:53 unused-4-162-brq-redhat-com cupsd[1292]: argv[2]="zdohnal"
Mar 15 16:22:53 unused-4-162-brq-redhat-com cupsd[1292]: argv[3]="fstab"
Mar 15 16:22:53 unused-4-162-brq-redhat-com cupsd[1292]: argv[4]="1"
Mar 15 16:22:53 unused-4-162-brq-redhat-com cupsd[1292]: argv[5]="brightness=270 finishings=3 gamma=1292 number-up=16 print-color-mode=monochrome saturation=167 job-uuid=urn:uuid:f566d530-5e5d-3ea3-787e-45c8bd727869 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1615821773 time-at-processing=1615821773 document-name-supplied=fstab ColorModel=Gray"
Mar 15 16:22:53 unused-4-162-brq-redhat-com cupsd[1292]: argv[6]="/var/spool/cups/d00836-001"

but it doesn't look like cupsd starts any of those image* filters - but I used file device queue and not a queue connected to real device, so that's can be the problem.

However, s-c-p doesn't influence what filters will be run, closing.

Thank you @tillkamppeter and @zdohnal

Quote of @tillkamppeter

After that you print a job.

How should I print a job? Via command line in a terminal or via an application (for example nomacs)?

Try A):
printing a pdf via application:
After in /var/log/cups/error_log I have found this:

D [17/Mar/2021:09:57:50 +0100] [Job 478] Adding default brightness=200
D [17/Mar/2021:09:57:50 +0100] [Job 478] Adding default gamma=9000
D [17/Mar/2021:09:57:50 +0100] [Job 478] Adding default saturation=5
[...]
D [17/Mar/2021:09:57:50 +0100] [Job 478] argv[5]="media=A4 sides=one-sided job-uuid=urn:uuid:f5fd2a08-8e36-3e15-738d-876157333d67 brightness=200 gamma=9000 saturation=5 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1615971470 time-at-processing=1615971470 document-name-supplied=0266a6058a9a4 Duplex=None PageSize=A4"
[...]

So it looks like filters will pick up and apply these values. But ...
-> Reality check: The print looks not like the settings "brightness, gamma, saturation" are applied. It's much too dark.

Try B):
Command in a terminal:
$ lp -o scaling=none /home/golddouble/Downloads/Druckversuche.png
(hoping, that it will print with the settings from "system-config-printer" when no option like "-o gamma=9000" is part of the command.)

In /var/log/cups/error_log I have found this:

[...]
D [17/Mar/2021:10:12:14 +0100] [Job 481] argv[5]="brightness=200 finishings=3 gamma=9000 media=om_a-4-fb_210x297mm number-up=1 output-bin=face-down print-color-mode=color saturation=5 scaling=0 sides=two-sided-long-edge job-uuid=urn:uuid:3cd02628-70c4-3039-6c6b-63f3daad4460 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1615972334 time-at-processing=1615972334 document-name-supplied=Druckversuche.png Duplex=DuplexNoTumble PageSize=A4.FB"
[...]

So it looks like filters will pick up and apply these values.
-> Reality check: The print looks like the settings "brightness, gamma, saturation" are applied. Seems to have worked.

.

Some further tries C) (tested each setting separate):
After I made further tries with a command in terminal:

1. brightness
Command: $ lp -o scaling=none /home/golddouble/Downloads/Druckversuche.png
Settings in "system-config-printer":
brightness=200
saturation=default
Gamma=default
--> Result: The print looks like "brightness" from "system-config-printer" has worked

2. saturation
Command: $ lp -o scaling=none /home/golddouble/Downloads/Druckversuche.png
Settings in "system-config-printer":
brightness=defaut
saturation=5
Gamma=default
--> Result: The print looks like "saturation" from "system-config-printer" has worked.
(Warning: But only if a colour picture was chosen for printing.)

3. gamma
Command: $ lp -o scaling=none /home/golddouble/Downloads/Druckversuche.png
Settings in "system-config-printer":
brightness=default
saturation=default
Gamma=9000
--> Result: The print looks like "gamma" from "system-config-printer" has worked.

Conclusion:
-It looks like "brightness", "gamma" and "saturation" in "job options" is the same like "brightness", "gamma" and "saturation" in the command $ lp -o scaling=none -o brightness=### -o gamma=#### -o saturation ### /home/golddouble/Downloads/Druckversuche.png
-As it are the same, this means, that this settings only work with the filter "imageto*"
-As this settings only work with the filter "imageto*", this means, that this filters only have an effect, when printing pictures via command line in a terminal. In addition "saturation" only works for colour-pictures.
-The method with checking the file /var/log/cups/error_log does not help, as you can see in try A): The values I have entered in "system-config-printer" were in /var/log/cups/error_log, but they were still not applied, as the reality check (printout) showed.
(edited)

The option were applied to the print job in all case, so no bug from system-config-printer point of view. If the job applied the option to filters and filters work with it properly is an other matter, which is out of scope of system-config-printer. It is a matter of CUPS and cups-filters.

@Golddouble this is because when you print from the command line the actual image file is sent to CUPS and converted using an imageto... filter. If you print from an application, the application sends the job in PDF format, making no imageto... filter being used and so the image parameters being ignored.

You can see in error_log which filters actually got used for a job.

Thank you. I appreciate your comments.

Sorry, of course saturation does not work, because I have used a greyscale picture. But as you have already told me: It works with a colour picture. (I have tested this in the meantime).
-> I have edited C) 2. and the whole conclusion in my previous post above.

I have found out, that I can also use my virtual PDF printer instead of my real hardware HP printer. The print results on the virtual/real paper are the same, but it's easier for testing. (Needs no paper and no ink. And I don't have to switch my printer on and off all the time.)


You can see in error_log which filters actually got used for a job.

Thank you for the hint. Very interesting.

I have had a look at it now:

A)
When I use my real hardware printer and print a png via command line, then I can find these filters in my error_log:

D [17/Mar/2021:14:10:06 +0100] [Job 503] 2 filters for job:
D [17/Mar/2021:14:10:06 +0100] [Job 503] imagetoraster (image/png to application/vnd.cups-raster, cost 100)
D [17/Mar/2021:14:10:06 +0100] [Job 503] hpcups (application/vnd.cups-raster to printer/ENVY-5540-series, cost 0)

B)
When I use my virtual PDF printer and print a png via command line, then I can find these filters in my error_log:

D [17/Mar/2021:13:21:51 +0100] [Job 494] 3 filters for job:
D [17/Mar/2021:13:21:51 +0100] [Job 494] imagetopdf (image/png to application/vnd.cups-pdf, cost 65)
D [17/Mar/2021:13:21:51 +0100] [Job 494] pdftops (application/vnd.cups-pdf to application/vnd.cups-postscript, cost 100)
D [17/Mar/2021:13:21:51 +0100] [Job 494] - (application/vnd.cups-postscript to printer/PDF, cost 0)

C)
When I use my virtual PDF printer and print a png from the application Nomacs, then I can find these filters in my error_log:

D [17/Mar/2021:14:37:09 +0100] [Job 508] 3 filters for job:
D [17/Mar/2021:14:37:09 +0100] [Job 508] pdftopdf (application/pdf to application/vnd.cups-pdf, cost 66)
D [17/Mar/2021:14:37:09 +0100] [Job 508] pdftops (application/vnd.cups-pdf to application/vnd.cups-postscript, cost 100)
D [17/Mar/2021:14:37:09 +0100] [Job 508] - (application/vnd.cups-postscript to printer/PDF, cost 0)

-> So I was able to reproduce by myself in C), that when printing via Nomacs there is no imageto* filter involved.