Getting wrong raster image size from CUPS
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 We really need to see the PPD file in question.
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.
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.
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
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 have you got time to investigate Ghostscript issue?
@skapas no, have you had a chance to add some logging of the raster header you are getting?
@michaelrsweet in our last attached error_log.txt log already contains all the details which we get from the CupsRasterReadHeader2.

@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...
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.