Bug 692733 - Regression: Ghostscript renders only a part of the attached PDF file when using a high resolution
Summary: Regression: Ghostscript renders only a part of the attached PDF file when usi...
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 9.04
Hardware: PC Linux
: P4 normal
Assignee: Michael Vrhel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-10 23:00 UTC by Till Kamppeter
Modified: 2012-01-25 09:10 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
Ausgabe-evince.pdf (47.50 KB, application/pdf)
2011-12-10 23:00 UTC, Till Kamppeter
Details
Simplified sample file (912 bytes, application/pdf)
2011-12-12 03:21 UTC, Alex Cherepanov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Till Kamppeter 2011-12-10 23:00:17 UTC
Created attachment 8205 [details]
Ausgabe-evince.pdf

Original report is

https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/902599

The attached PDF file contains three red rectangles with "Presse" written in them, at the top two vertical ones and a horizontal one at the bottom.

Running the file through the following command line

cat Ausgabe-evince.pdf | /usr/bin/gs -dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -sDEVICE=png16m -sstdout=%stderr -sOutputFile=%stdout -r200x200 -_ > out.png

lets only show the horizontal rectangle at the bottom show in out.png. The problem only occurs with high, printing-typical resolutions. If I use "-r100x100" I get correct output. All higher resolutions only give me the horizontal "Presse" at the bottom.

The output device does not matter. The original command line with the "cups" output device

cat Ausgabe-evince.pdf | /usr/bin/gs -dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -sDEVICE=cups -sstdout=%stderr -sOutputFile=%stdout -sMediaType=Plain -sOutputType=0 -dDuplex -r600x600 -dMediaPosition=7 -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=832 -dcupsBitsPerColor=8 -dcupsColorOrder=0 -dcupsColorSpace=17 -scupsPageSizeName=A4 -I/usr/share/cups/fonts -c -f -_ > out.raster

shows the same problem and also changing the color space parameters or removing all parameters except "-sstdout=%stderr -sOutputFile=%stdout -sDEVICE=cups -r600x600" shows the problem.

Whenever the problem occurs, Ghostscript takes an unusually long time to finish.

Using the "cups" output device in a monochrome mode, like with this command line

cat Ausgabe-evince.pdf | /usr/bin/gs -sDEVICE=cups -sstdout=%stderr -sOutputFile=%stdout -r600x600 -_ > out.raster

lets the upper right rectangle with vertical "Presse" appear in a very light gray.

To visualize CUPS Raster files I use

http://www.easysw.com/~mike/rasterview/index.html
Comment 1 Alex Cherepanov 2011-12-12 03:21:39 UTC
Created attachment 8208 [details]
Simplified sample file

This is a simplified sample file. I've replaced all text with a gray background
and reduced the file to 6 objects.

The problem is also a regression. V. 8.71 renders the file correctly, but vv. 9.00+ don't.

Original file has many layers of forms, patterns, and transparency but the
simplified file has just one big pattern.
Comment 2 Marcos H. Woehrmann 2011-12-15 17:04:50 UTC
This broke with the icc_work branch merge.
Comment 3 Till Kamppeter 2012-01-12 19:56:02 UTC
The "Simplified sample file" (in the sample command lines gs-bug692733.pdf) shows, when correctly rendered, a red rectangle on a gray background. You see this when screen-displaying the file with evince (Poppler), Adobe Reader, or gs (without further options, to default to low-res X screen display).

Hi-res Ghostscript output (for printing) is broken. Here the resulting output has a white background.

Simplest example command line for the "cups" output device:

cat gs-bug692733.pdf  | /usr/bin/gs -sDEVICE=cups -sstdout=%stderr -sOutputFile=%stdout -r600x600 -dcupsColorSpace=1 -_ > out.raster

Same happens for a PNG output device, simplest command line here:

cat gs-bug692733.pdf  | /usr/bin/gs -sDEVICE=png16m -sstdout=%stderr -sOutputFile=%stdout -r600x600 -_ > out.png

You get correct output again with a much lower resolution:

cat gs-bug692733.pdf  | /usr/bin/gs -sDEVICE=png16m -sstdout=%stderr -sOutputFile=%stdout -r60x60 -_ > out.png
Comment 4 Michael Vrhel 2012-01-24 07:25:52 UTC
This is an interesting one.  Here is what I see so far.  Just going out to tiff24nc at 300dpi the pattern is a clist and we do not have the gray background in the final output.   At 150dpi the pattern is rendered (not clist) and we end up with the gray background in the final output.  However, the pattern buffer itself does not have the gray background the only final rendered output does.  Will dig further tomorrow to see where and when the gray background is getting put in and why it is not happening in the clist case.  I do see the color remap for the gray occur in both cases.
Comment 5 Michael Vrhel 2012-01-25 00:33:15 UTC
Fixed with http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=83ce7cf6c9252c39e280040b12db1dcfbd8a7cb2

I don't believe this broke with the ICC branch merge but from an incorrect clearing of the pattern when the pattern is a clist.
Comment 6 Till Kamppeter 2012-01-25 09:10:36 UTC
I have tried the fix on GhostScript 9.04 and there it has no effect at all. Do I need additional patches for 9.04?