cups icon indicating copy to clipboard operation
cups copied to clipboard

Getting wrong raster image size from CUPS

Open skapas opened this issue 3 years ago • 11 comments

I am from Lexmark driver development team. Recently we encountered with an issue regarding wrong raster image size from CUPS. We have an entry in our PPD file like "*cupsFilter: "application/vnd.cups-raster 0 <Lexmark Filter>". In our filter we retrieve the raster image's header information through CUPS's API "CupsRasterReadHeader2()". We have found that the wrong image size of raster image for a Custom paper size input. Not sure for other input. The details is given below.

    Input                                       Raster Image size getting                             Expected Image size
 =======                                =====================                        ===================
110x220mm (Envelop DL)                    312x624                                                312x624    (Correct)
105x210mm                                           312x624                                                298x596   (Wrong)
105x209mm                                          298x592                                                298x592.  (Correct)

The problem we are getting from different applications like Document Viewer and Firefox as well as Command line printing. The command we have used is lp -d <queue name> -o PageSize=Custom.<page size> -o fit-to-page <file to print>

Need help urgently. Please look into it.

skapas avatar May 02 '22 07:05 skapas

@skapas We really need to see the PPD file in question.

michaelrsweet avatar May 02 '22 10:05 michaelrsweet

Also, a CUPS error_log file with debug logging (cupsctl --debug-logging) showing the jobs in question will tell us what is happening in the raster filters.

michaelrsweet avatar May 02 '22 11:05 michaelrsweet

error_log.txt Lexmark_ppd.txt

Hi Michael, I have attached the log and ppd file. Regards Saptarshi

skapas avatar May 02 '22 13:05 skapas

OK, could you try this on a newer version of CUPS? This looks like a media matching bug, but I know we made changes for CUPS 2.4 to allow for media sizes with such a small difference in size.

michaelrsweet avatar May 02 '22 15:05 michaelrsweet

We have installed the CUPS version 2.4.2 by compiling the source code of CUPS in local machine. We have also checked the issue was not resolved. Attaching the CUPS error_log file. error_log.txt

skapas avatar May 03 '22 11:05 skapas

OK, it would be helpful if your filter logged the raster header it was getting. Nothing inside CUPS is going to be changing the media size, and I double-checked that the current comparison/matching code uses an epsilon of 0.5mm. So my guess is a Ghostscript issue, but I need to do some more digging...

michaelrsweet avatar May 04 '22 12:05 michaelrsweet

@michaelrsweet have you got time to investigate Ghostscript issue?

skapas avatar May 23 '22 11:05 skapas

@skapas no, have you had a chance to add some logging of the raster header you are getting?

michaelrsweet avatar May 23 '22 11:05 michaelrsweet

@michaelrsweet in our last attached error_log.txt log already contains all the details which we get from the CupsRasterReadHeader2. Screenshot 2022-06-28 at 2 57 29 PM

skapas avatar Jun 28 '22 09:06 skapas

@skapas The log data you quoted in your comment shows the DL envelope size being used, with the correct raster dimensions.

Please provide separate log file attachments showing a working and non-working job - maybe then we can make some progress here but at the moment it doesn't look like anything in CUPS is broken, but it might be one of the filters that is shipped separate from CUPS...

michaelrsweet avatar Jun 29 '22 17:06 michaelrsweet

No response from the reporter over one month, I'm going to close the issue. In case the issue persists, please let us know and provide the requested data.

zdohnal avatar Aug 26 '22 06:08 zdohnal