[bug-gs] psmono device renders too little.
Fruhwirth Clemens
clemens-dated-1037131870.cad5@endorphin.org
Thu, 7 Nov 2002 21:11:09 +0100
--g7w8+K/95kPelPD2
Content-Type: multipart/mixed; boundary="hYooF8G/hrfVAmum"
Content-Disposition: inline
--hYooF8G/hrfVAmum
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi!
psmono and it's buddies render too little postscript images in the lower
left corner.
gs -sPAPERSIZE=a4 -sDEVICE=psmono -sOutputFile=output.ps input.ps
Setting the resolution to 72dpi resizes the whole image, which should not
happend imho. The postscript procedure in the output file responsible for
decoding the image is '.ImageRead'. It takes 5 args from the stack, that
include 'xres' 'yres'. Replacing "300 300" with "72 72" fixes the problem.
You can have a look at my input.ps, my original psmono output output.ps
and my edited output1.ps at
http://therapy.endorphin.org/gs-bug/input.ps
http://therapy.endorphin.org/gs-bug/output.ps
http://therapy.endorphin.org/gs-bug/output1.ps
It looks like the width/heigth, xres/yres computation is flawed.
The relevant source part is gs-7.05/src/gdevpsim.c:182
Forcing xres, yres to 72 seems to work for all resolutions, because the width
and heigth parameters are adjusted instead, but I doubt that is the correct
solution, however patch is attached, version: GNU Ghostscript 7.05
Regards, Clemens
--hYooF8G/hrfVAmum
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="gs-trivial.diff"
Content-Transfer-Encoding: quoted-printable
--- gs/ghostscript-7.05/src/gdevpsim.c Fri Feb 22 20:45:56 2002
+++ gs-7.05/src/gdevpsim.c Thu Nov 7 21:02:26 2002
@@ -180,8 +180,7 @@
=20
/* Write the .ImageRead command. */
fprintf(prn_stream,
- "%g %g %d %d %d .ImageRead\n",
- pdev->HWResolution[0], pdev->HWResolution[1],
+ "72 72 %d %d %d .ImageRead\n",
pdev->width, pdev->height, pdev->color_info.depth);
=20
/* Compress each scan line in turn. */
--hYooF8G/hrfVAmum--
--g7w8+K/95kPelPD2
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE9ysjdHkYGUbdPrgQRAkmLAJ0UANtLwexA3kUtGHumQSyqlkT8ygCfTU2W
2Z19ffa8pIlaA7rdLKkZMXg=
=ROh2
-----END PGP SIGNATURE-----
--g7w8+K/95kPelPD2--