Re: Help with ps2raster Cutting Off Image

"Kwok, Marcus B." <[email protected]> Tue, 26 Aug 2014 16:50:27 +0000
Newsgroups gmane.comp.gis.gmt.user
Message-ID <[email protected]>
I see it now, thanks!

--=20
Marcus Kwok <[email protected]>
Johns Hopkins University Applied Physics Laboratory,=A0AOS QAT Group
Office: 21-S233I=A0=A0=A0=A0=A0=A0=A0=A0=A0 Mailstop: 21-S246
Phone: (443) 778-7858 (Baltimore) or (240) 228-7858 (DC)


-----Original Message-----
From: World-Wide GMT Usage and Help Mailing List [mailto:[email protected]=
aii.edu] On Behalf Of Paul Wessel
Sent: Tuesday, August 26, 2014 12:41
To: [email protected]
Subject: Re: [GMT-HELP] Help with ps2raster Cutting Off Image

It was changed to double quotes for windows last week.
Paul

Sent from my iPad

> On Aug 26, 2014, at 5:28 AM, "Kwok, Marcus B." <[email protected]> w=
rote:
>=20
> Hi Paul,
> I am unable to test the SVN version, but looking at the SVN log, I see th=
at you are using single quotes around the filenames.  I'm sure this should =
be fine on Linux, but on Windows, they use double quotes to quote filenames=
 with spaces (I am on a Windows system).  Do you think this will be an issu=
e?
>=20
> Thanks,
> Marcus
>=20
> --
> Marcus Kwok <[email protected]>
> Johns Hopkins University Applied Physics Laboratory, AOS QAT Group
> Office: 21-S233I          Mailstop: 21-S246
> Phone: (443) 778-7858 (Baltimore) or (240) 228-7858 (DC)
>=20
>=20
> -----Original Message-----
> From: World-Wide GMT Usage and Help Mailing List=20
> [mailto:[email protected]] On Behalf Of Paul Wessel
> Sent: Monday, August 18, 2014 13:31
> To: [email protected]
> Subject: Re: [GMT-HELP] Help with ps2raster Cutting Off Image
>=20
> Thanks Marcus-
>=20
> I guess we are prejudiced against filenames with spaces so there were no =
check for this in the system calls to GS and GDAL.
> Fixed in r10252 (GMT4) and r13441 (GMT5).
>=20
> -p
>=20
>> On Aug 18, 2014, at 6:33 AM, Kwok, Marcus B. <[email protected]> wr=
ote:
>>=20
>> So, I have upgraded to GMT 4.5.12 and switched to using PAPER_MEDIA=3Dle=
tter instead of letter+, producing plain PS instead of EPS.  Ps2raster now =
converts the file correctly in my tests, however, in production, the paths =
have spaces in them and so ps2raster fails.  Ghostscript itself has no prob=
lems dealing with spaces in the path as long as the filenames are quoted (s=
o my current workaround still works).  Would it be possible to get this add=
ed to ps2raster?
>>=20
>> --
>> Marcus Kwok <[email protected]>
>> Johns Hopkins University Applied Physics Laboratory, AOS QAT Group
>> Office: 21-S233I          Mailstop: 21-S246
>> Phone: (443) 778-7858 (Baltimore) or (240) 228-7858 (DC)
>>=20
>> From: World-Wide GMT Usage and Help Mailing List=20
>> [mailto:[email protected]] On Behalf Of Paul Wessel
>> Sent: Wednesday, August 13, 2014 18:12
>> To: [email protected]
>> Subject: Re: [GMT-HELP] Help with ps2raster Cutting Off Image
>>=20
>> Cannot really reproduce this since 4.5.2 was some time ago.  The eps stu=
ff was yanked as we could not do a good job without full access to font met=
rics.  So better to use more recent GMT and specify the paper size you want=
.  You can use an exact custom papersize to impose your own boundingbox, or=
 use ps2raster -A if you want a tight one.
>>=20
>> -p
>>=20
>> On Aug 13, 2014, at 11:05 AM, Kwok, Marcus B. <[email protected]> w=
rote:
>>=20
>>=20
>> Hello,
>> I am programmatically generating an EPS file using GMT, and then convert=
ing it to PNG using ghostscript.  However, when I use ps2raster, part of th=
e file gets cut off.
>>=20
>> I have reduced my "script" to a pretty minimal example that demonstrates=
 my issue.  The size of the image is supposed to represent a letter-size (8=
.5"x11") sheet of paper, with "UNCLASSIFIED" printed in the top right and b=
ottom left corners (in the production map, there are additional annotations=
 on the page as well).  After running ps2raster, the "UNCLASSIFIED" at the =
top of the image gets cut off, and the margin on the right side of the map =
is now smaller.
>>=20
>> pscoast -R-180.0/180.0/-60.0/90.0 -B30g15/30g15=20
>> --PLOT_DEGREE_FORMAT=3DdddF --DEGREE_SYMBOL=3Ddegree -JQ0.0/8.5i
>> -G178/255/178 -S130/239/255 -Dc -W -K --PAPER_MEDIA=3Dletter+ >=20
>> test.eps
>>=20
>> pstext classification.txt -JX8.5i/6.5i -R-4.25/4.25/0/6.5 -N -O=20
>> --PAPER_MEDIA=3Dletter+ >> test.eps
>>=20
>> ps2raster test.eps -E72 -Qt4 -Tg
>>=20
>> gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=3Dpng16m -r72 -dTextAlphaBits=3D4=
=20
>> -sOutputFile=3Dgs.png -ftest.eps
>>=20
>> Here are the contents of the classification.txt file:
>> -4.25 -0.5 12 0 0 TC UNCLASSIFIED
>> 4.25 7 12 0 0 BC UNCLASSIFIED
>>=20
>> When I run gswin32c directly, the entire image is visible, so I have a w=
orkaround in place.
>>=20
>> I have attached my sample output (the PNG files have been rotated manual=
ly to the correct orientation, as my application handles that automatically=
).
>>=20
>> I am using (an admittedly old version) GMT 4.5.2, but I don't think it i=
s a bug, but more so that I am doing something incorrectly when creating th=
e file or the annotations.  Is there a way to specify the BoundingBox to ps=
2raster?
>>=20
>> Thanks,
>> Marcus
>>=20
>> --
>> Marcus Kwok <[email protected]>
>> Johns Hopkins University Applied Physics Laboratory, AOS QAT Group
>> Office: 21-S233I          Mailstop: 21-S246
>> Phone: (443) 778-7858 (Baltimore) or (240) 228-7858 (DC)
>>=20
>> Mailing list for GMT discussions of all kinds. If you are not sure=20
>> you have found a bug, discuss it here first. To formally report bugs=20
>> or request features, please register and add New Issue on=20
>> gmt.soest.hawaii.edu To unsubscribe, send the message "signoff=20
>> gmt-help" to [email protected] Note: gmt-help will become=20
>> obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu=20
>> instead. <test.eps><test.png><gs.png>
>>=20
>> Mailing list for GMT discussions of all kinds. If you are not sure you h=
ave found a bug, discuss it here first. To formally report bugs or request =
features, please register and add New Issue on gmt.soest.hawaii.edu To unsu=
bscribe, send the message "signoff gmt-help" to [email protected] N=
ote: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gm=
t.soest.hawaii.edu instead.
>> Mailing list for GMT discussions of all kinds. If you are not sure you h=
ave found a bug, discuss it here first. To formally report bugs or request =
features, please register and add New Issue on gmt.soest.hawaii.edu To unsu=
bscribe, send the message "signoff gmt-help" to [email protected] N=
ote: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gm=
t.soest.hawaii.eduinstead.
>=20
> Mailing list for GMT discussions of all kinds.  If you are not sure you h=
ave found a bug, discuss it here first.
> To formally report bugs or request features, please register and add=20
> New Issue on gmt.soest.hawaii.edu To unsubscribe, send the message=20
> "signoff gmt-help" to [email protected]
> Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on=
 gmt.soest.hawaii.edu instead.
>=20
> Mailing list for GMT discussions of all kinds.  If you are not sure you h=
ave found a bug, discuss it here first.
> To formally report bugs or request features, please register and add=20
> New Issue on gmt.soest.hawaii.edu To unsubscribe, send the message=20
> "signoff gmt-help" to [email protected]
> Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on=
 gmt.soest.hawaii.edu instead.

Mailing list for GMT discussions of all kinds.  If you are not sure you hav=
e found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Is=
sue on gmt.soest.hawaii.edu To unsubscribe, send the message "signoff gmt-h=
elp" to [email protected]
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on g=
mt.soest.hawaii.edu instead.

Mailing list for GMT discussions of all kinds.  If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to [email protected]
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.