Bug 114471

Summary: Invalid scaling in devices psgray/psmono/psrgb
Product: [Retired] Red Hat Linux Reporter: Krzysio (Chris) Leszczynski <chris>
Component: ghostscriptAssignee: Tim Waugh <twaugh>
Status: CLOSED CANTFIX QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 9CC: mattdm
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-01-02 18:37:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Krzysio (Chris) Leszczynski 2004-01-28 15:12:58 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1)
Gecko/20030225

Description of problem:
Ghostscript using devices psgray and psmono assumes -r72 and scales
down the final picture if its larger.  psrgb appears to scale
correctly.



Version-Release number of selected component (if applicable):
ghostscript-7.05-32.1

How reproducible:
Always

Steps to Reproduce:
1.
 gs -sDEVICE=psgray -sPAPERSIZE=letter -r300 \
      -sOutputFile=tiger-gray-300.ps \
      /usr/share/ghostscript/*/examples/tiger.ps
2.
 gs -sDEVICE=psrgb -sPAPERSIZE=letter -r300 \
      -sOutputFile=tiger-rgb-300.ps \
      /usr/share/ghostscript/*/examples/tiger.ps

3. gv tiger-gray-300.ps
4. gv tiger-rgb-300.ps
    

Actual Results:  tiger-rgb-300.ps looks correctly -- I have included
it for reference only.
tiger-gray-300.ps is scaled down, it occupies lower-right corner
of the paper.

Expected Results:  Both pictures should be similar
(save the obvious lack of colors in psgray).


Additional info:

There is an easy way to correct it.  The driver incorrectly adds
a "scale" command in each %%PageSetup.

I have known this problem for years and always postprocess it
through:
    perl -pe 's/^(.*) scale/% removed $1 scale/'

A bug lies in /.ImageRead procedure, in psmono_setup[] in
BUILD/ghostscript-7*/src/gdevpsim.c:107
the procedure accepts a resolution from the stack but
then it hard-codes 72dpi.

Comment 1 Tim Waugh 2004-01-28 15:43:07 UTC
For reference, the relevant part is:

    "/.ImageRead {"     /* <xres> <yres> <width> <height> <bpc>
.ImageRead - */
    "  gsave [",
        /* Stack: xres yres width height bpc -mark- */
    "    6 -2 roll exch 72 div 0 0 4 -1 roll -72 div 0 7 index",
        /* Stack: width height bpc -mark- xres/72 0 0 -yres/72 0 height */
    "  ] { .ImageItem }",
        /* Stack: width height bpc <matrix> <proc> */
    "  4 index 3 index mul 7 add 8 idiv string currentfile 0 ()",
        /* Stack: width height bpc <matrix> <proc> <buffer> <file> 0 () */
    "  9 4 roll",
        /* Stack: <buffer> <file> 0 () width height bpc <matrix> <proc> */
    "  image pop pop pop pop grestore",
    "} def",


Comment 2 Bill Nottingham 2006-08-05 03:42:58 UTC
Red Hat apologizes that these issues have not been resolved yet. We do want to
make sure that no important bugs slip through the cracks.

Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
They are maintained by the Fedora Legacy project (http://www.fedoralegacy.org/)
for security updates only. If this is a security issue, please reassign to the
'Fedora Legacy' product in bugzilla. Please note that Legacy security update
support for these products will stop on December 31st, 2006.

If this is not a security issue, please check if this issue is still present
in a current Fedora Core release. If so, please change the product and version
to match, and check the box indicating that the requested information has been
provided.

If you are currently still running Red Hat Linux 7.3 or 9, please note that
Fedora Legacy security update support for these products will stop on December
31st, 2006. You are strongly advised to upgrade to a current Fedora Core release
or Red Hat Enterprise Linux or comparable. Some information on which option may
be right for you is available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Any bug still open against Red Hat Linux 7.3 or 9 at the end of 2006 will be
closed 'CANTFIX'. Again, if this bug still exists in a current release, or is a
security issue, please change the product as necessary. We thank you for your
help, and apologize again that we haven't handled these issues to this point.


Comment 4 Bill Nottingham 2007-01-02 18:37:07 UTC
Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
f you are currently still running Red Hat Linux 7.3 or 9, you are strongly
advised to upgrade to a current Fedora Core release or Red Hat Enterprise Linux
or comparable. Some information on which option may be right for you is
available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Closing as CANTFIX.