cups icon indicating copy to clipboard operation
cups copied to clipboard

lp fails to print jpeg files

Open garydale opened this issue 3 months ago • 11 comments

Before you write the report Read the REPORTING_ISSUES.md file in the main repository and prepare data mentioned there which looks relevant to you issue.

Describe the bug lp -d <photo.jpeg> fails to produce output no matter whether the queuse is a class or an individual printer. The job does show up in the completed list however.

To Reproduce Steps to reproduce the behavior:

  1. run the command above.

Expected behavior I expect to see output

Screenshots If applicable, add screenshots to help explain your problem.

System Information:

  • Debian/Trixie on an AMD64 laptop
  • lp
  • CUPS version 2.4.10

Additional context I note that lp does print PDFs on my file/print server running the same Debian version.

garydale avatar Nov 03 '25 16:11 garydale

Please provide:

  • Exact version of cups and cups-filters installed on your system
  • Generated PPD file for your printer (/etc/cups/ppd/)
  • The job file c****** from /var/spool/cups/, the most recent would have higher number: print the document with the issue first, copy the file after printing

As well as the CUPS debug logs, which could be activated with cupsctl --debug-logging

  • /var/log/cups/error_log

ValdikSS avatar Nov 04 '25 23:11 ValdikSS

On Apple systems, there used to be a imagetopdf filter. Similar on Linux. Anything of that sort on your system?

HinTak avatar Nov 06 '25 08:11 HinTak

Further to my original report, I installed lpr, which I had been using earlier to do the printing, and it returns a printer-not-found error (same command as above except that the option to select a printer is -P. instead of -d)

Again, I can print to this printer from the CUPS localhost:631 page (to print a test page). I can also print to it from a GUI image viewer program.

This is using the driverless driver for the printer, which is attached via a USB cable. It's an EPSON XP-6100 inkjet.

The printer attached to my server is an older one (HP CP-1215) that uses a driver. It works fine with lp (but no longer allows me to print from my workstation - I usually just create a PDF then use lp in an SSH session. I've reported that problem many times over the last 3 years).

This being Debian/Stable, the CUPS version is 2.4.10-3+deb13u1 and the CUPS filter version is 1.28.17-6

garydale avatar Nov 15 '25 02:11 garydale

Without the data in my message above it's not possible to help in any way.

ValdikSS avatar Nov 15 '25 10:11 ValdikSS

error_log.txt

Unfortunately the page doesn't actually let me directly attach those files. As a work-around, I've added a .txt extension to them. There is nothing in the error log except for a mention of a color profile for the printer already existing from when I first installed CUPS & the printer locally. I've just attached the new log with debug logging turned on.

c00008.txt EPSON_XP_6100_Series_USB.ppd.txt

garydale avatar Nov 16 '25 15:11 garydale

Your printer reports that the job is completed, but the printed pages = 0.

You're using the print queue generated by cups-browsed. You should have another queue as well, with the different but similar name. Try to print using it first of all, and see if it works.

If it doesn't, try the following:

  1. sudo systemctl disable --now cups cups-browsed
  2. sudo sed -i -e 's~image/urf image/urf~image/pwg-raster image/pwg-raster~' -e '/image\/jpeg/d' /etc/cups/ppd/EPSON_XP_6100_Series_USB.ppd
  3. sudo systemctl enable --now cups

This will disable cups-browsed and force PWG-raster format instead of Apple raster for your printer. Try to print after that.


@tillkamppeter despite *cupsFilter2: "image/jpeg image/jpeg 0 -" being present in the PPD, and the printer supports JPEG, the processing flow due to implicitclass seems to be: JPEG → implicitclass → pdftoippprinter → gstoraster → rastertopwg → Apple Raster
Is this intended and documented?

ValdikSS avatar Nov 16 '25 21:11 ValdikSS

The modifications to the .ppd aren't needed. They cause the print to screw up - only characters instead of a photo. However the ppd restored and cups-browsed disabled, the printing is coming out.

Unfortunately, I find I am now unable to set the default options for the printer. The photo printed with a border rather than borderless. It appears to have shrunk to fit. In fact, after printing, the printer itself has vanishes from the CUPS web interface.

It seems to be treated as a "temporary printer" for some reason. I don't seem to be able to remove it nor add it in.

If I re-enable cups-browsed, the printer comes back, with the correct default options, but then I can't print to it.

To be clear, there is a wifi interface for the printer but I have not set it up on this computer. It doesn't show up in the list of printers but if it did, it would not have the same name as the USB-attached printer. I don't use the wifi interface for this application because I'm not going to have access to my router from my laptop. I can only use printers that connect directly to it.

garydale avatar Nov 17 '25 22:11 garydale

You have a so-called driverless printer. In CUPS, there are two PPD generators for driverless printers: IPP Everywhere build into CUPS, and "driverless" built into cups-browsed. The latter creates permanent printer (permanent queue), but the former creates only temporary queue which is removed in 1 minute after the printing process ends, which you used without cups-browsed running.

Both PPD generators come with their own slightly different printing process. It seems that either your printer or the cups-browsed pipeline is faulty for JPEGs.

You can try to stop cups-browsed once again, and add the printer using: http://127.0.0.1:631/admin → find new printers → select your printer (the connection string should start with dnssd://) → Make: Generic, Model: IPP Everywhere And test it in this configuration.

ValdikSS avatar Nov 17 '25 22:11 ValdikSS

I tried that already. With cups-browsed off, the printer doesn't show up and can't be found. The closest I get is a local printer with "Epson Backend (Epson Inkjet Printer #1)", However, if I try to set it up, I get taken to the network printer dialogue except that there are garbage letters in the printer connection field (similar to the problem I reported with modifying printer classes).

I don't think the problem can possibly be with the printer or browsed pipeline because the problem only impacts printing from the command line. I can print fine from GUI applications. Moreover, there are other issues I am having across multiple computers relating to CUPS

  1. can't modify printer classes
  2. can't print to the colour laser printer attached via USB to my server. It's shared and shows up but nothing prints except when I use lp on the server..

These are with Debian/Stable which should just work. Problem 2 seems to be similar to the problem in this thread. Lp works locally but when the printer is found using browsed, it doesn't work (the server is headless, so I can't test printing via a gui but I can print to it from a Windows 10 VM as http://server:631/cp1215).

I'll try grabbing the connection information with browsed running, then turn it off and try to force the add printer dialogue to take it. I'll let you know later if this works.

garydale avatar Nov 18 '25 14:11 garydale

FWIW, if you want a permanent queue just use the lpadmin command or the web interface to create the printer, or do:

lpadmin -p NAME -o printer-is-temporary=false

michaelrsweet avatar Nov 18 '25 15:11 michaelrsweet

The lpadmin command didn't make the existing printer permanent with browsed off. However I was able to add again through the web interface. Browsed seems to have grabbed the _USB name so the added queue now just ends in _

I note that the media names are different between the printer browsed detects and the one I added. However, when I set the default options the second time, the media names change to the ones from the browsed detected printer. These names have some garbage characters in them - probably trying to show inches but I see an a with caret followed by a superscript 3.

Strangely, the photo is printing a little larger now than it was previously. I'll have to adjust my script to shrink the photo a little more.

A word on the web interface: I keep getting tripped up by the "add/modify printer" button. It looks like it is associated with the provide a ppd file selector and not the entire form. Perhaps a blank line could be added to separate it from the "browse" button. Or draw a box around the options and have the add/modify button external to the box.

Anyway, I've got the printer working and printing with the default options I set. Presumably I can use the process to add in the other printers I use for this. I'm still appalled at the hoops I have to jump through to get to this point, but they seem to be manageable.

Thanks.

garydale avatar Nov 18 '25 17:11 garydale