Bug 690948 - BoundingBox/MediaSize info initialized too late in pxlcolor
Summary: BoundingBox/MediaSize info initialized too late in pxlcolor
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Vectors (show other bugs)
Version: master
Hardware: PC Linux
: P4 normal
Assignee: Hin-Tak Leung
Keywords: bountiable
Depends on:
Reported: 2009-11-22 18:59 UTC by Hin-Tak Leung
Modified: 2021-02-14 07:52 UTC (History)
2 users (show)

See Also:
Word Size: ---

Sample file (110 bytes, application/postscript)
2021-02-14 07:52 UTC, Peter Cherepanov

Note You need to log in before you can comment on or make changes to this bug.
Description Hin-Tak Leung 2009-11-22 18:59:17 UTC
Bug690683.ps from tests_private/comparefiles has an unusual issue when processed
by the pxlcolor driver - the boundingbox info is only available after a few
drawing instructions (I think one of them is a design issue of gdevvec where a
clip path is issued on open). This causes a problem with PXL since the page
dimension are attributes of BeginPage and cannot be easily changed after drawing
starts, when compared with other devices.

I tried delaying the BeginPage until the first NewPath. (width/height are letter
size values on entry, and reaches the final values only a few drawing
instructions in).

A workaround is to run -sDEVICE=bbox first and then set the dimension with -g
explicitly; otherwise the file is wrongly processed as letter size.
Comment 1 Hin-Tak Leung 2009-11-22 19:08:02 UTC
While looking at this, I wonder why the DSC info is not used for setting the
device width/height at all. The PS file concerned have DSC PageBoundingBox, and
also does a (clip?) path early on in postscript code.
Comment 2 Ray Johnston 2009-12-03 09:54:44 UTC
There is a 'fillpage' procedure that may be a better place to issue the
Comment 3 Hin-Tak Leung 2009-12-03 10:24:59 UTC
Thanks for the tips - I'll give it a try.
Comment 4 Peter Cherepanov 2021-02-14 07:52:59 UTC
Created attachment 20614 [details]
Sample file

This problem still occurs in the current version.
gs -sDEVICE=pxlcolor -o a.pxl a.ps
generates empty Letter-sized file instead of 1000x1000 point page with a black square.