Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check the bounding box set by gksm2ps #366

Open
karlmsmith opened this issue Nov 22, 2017 · 1 comment
Open

check the bounding box set by gksm2ps #366

karlmsmith opened this issue Nov 22, 2017 · 1 comment

Comments

@karlmsmith
Copy link
Contributor

karlmsmith commented Nov 22, 2017

Reported by @AnsleyManke on 23 Jan 2004 22:00 UTC
Report by Dan Hodson, <dan@met.reading.ac.uk> 1/22/2004
Hi,

I've come across what appears to be a small bug in gksm2ps Mod 1.06
(I think this is the version distributed with Ferret 5.53?).

It concerns the BoundingBox that gksm2ps calculates when converting
to a postscript file.

If I run the following ferret script:

! NOAA/PMEL TMAP
! Program FERRET
! Version 5.22 - 07/27/00
! 22-Jan-04 17:55

use coads_climatology
set mode meta landscape.plt
shade SST[l=1]
cancel mode metafile
exit

and then do:

gksm2ps -R -o landscape.ps landscape.plt

and inspect the ps file:

%!PS-Adobe-1.0
%%Title: landscape.ps
%%Creator: gksm2ps Mod 1.06 / XPPLP Profile F 1.0 [oX]
%%CreationDate: 18:12:43 Thursday, 22 January 2004
%%BoundingBox: 62 18 729 593


It appears that the last two values in the BoundingBox are in the
wrong order.

If I modify the first line of landscape.ps to read

%!PS-Adobe-1.0 EPSF-1.2


and then do:

ghostview landscape.ps

Then the image is cropped incorrectly.

If I now swap the last two coordinates the BoundingBox
in landscape.ps

%!PS-Adobe-1.0 EPSF-1.2
%%Title: landscape.ps
%%Creator: gksm2ps Mod 1.06 / XPPLP Profile F 1.0 [oX]
%%CreationDate: 18:12:43 Thursday, 22 January 2004
%%BoundingBox: 62 18 593 729


and then do:

ghostview landscape.ps

Then the BoundinBox fits perfectly.



This doesn't always happen. For instance if I run this
script:

! NOAA/PMEL TMAP
! Program FERRET
! Version 5.22 - 07/27/00
! 22-Jan-04 17:55
set window/aspect=1.32
use coads_climatology
set mode meta portrait.plt
shade SST[l=1]
cancel mode metafile
exit

and then do:

gksm2ps -R -o portrait.ps portrait.plt

modify the first line of portrait.ps to read:

%!PS-Adobe-1.0 EPSF-1.2


and do:

ghostview portrait.ps

Then the BoundingBox is correct.


Is this a known issue?


This only became an issue when I attempted to convert ps
files produced using gksm2ps into gif files using the
imagemagick convert tool. This uses the BoundingBox to
work out the extent of the image when rendering postscript
to a bitmap - consequently it crops it incorrectly.

There is a worked-around; by converting to eps using ps2epsi
which appears to recalculate the BoundingBox, and then using
the epsi file. But I thought you might like to know anyway!

Cheers,

Dan 

Dan Hodson CGAM, Department of Meteorology
tel: +44/0 118 378 7901 University of Reading
fax: +44/0 118 378 8905 Earley Gate, PO Box 243
www: www.met.rdg.ac.uk/~dan Reading, RG6 6BB, UK

Migrated-From: http://dunkel.pmel.noaa.gov/trac/ferret/ticket/770

@karlmsmith
Copy link
Contributor Author

karlmsmith commented Nov 22, 2017

Comment by @AnsleyManke on 10 Feb 2004 21:20 UTC
Move from component "All" to component "PLOT+"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant