Discussion:
Help with ps2raster Cutting Off Image
Kwok, Marcus B.
2014-08-13 21:05:02 UTC
Permalink
Hello,
I am programmatically generating an EPS file using GMT, and then converting it to PNG using ghostscript. However, when I use ps2raster, part of the file gets cut off.

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 bottom 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.

pscoast -R-180.0/180.0/-60.0/90.0 -B30g15/30g15 --PLOT_DEGREE_FORMAT=dddF --DEGREE_SYMBOL=degree -JQ0.0/8.5i -G178/255/178 -S130/239/255 -Dc -W -K --PAPER_MEDIA=letter+ > test.eps

pstext classification.txt -JX8.5i/6.5i -R-4.25/4.25/0/6.5 -N -O --PAPER_MEDIA=letter+ >> test.eps

ps2raster test.eps -E72 -Qt4 -Tg

gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=png16m -r72 -dTextAlphaBits=4 -sOutputFile=gs.png -ftest.eps

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

When I run gswin32c directly, the entire image is visible, so I have a workaround in place.

I have attached my sample output (the PNG files have been rotated manually to the correct orientation, as my application handles that automatically).

I am using (an admittedly old version) GMT 4.5.2, but I don't think it is a bug, but more so that I am doing something incorrectly when creating the file or the annotations. Is there a way to specify the BoundingBox to ps2raster?

Thanks,
Marcus

--
Marcus Kwok <***@jhuapl.edu<mailto:***@jhuapl.edu>>
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)


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 ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Paul Wessel
2014-08-13 22:12:03 UTC
Permalink
Cannot really reproduce this since 4.5.2 was some time ago. The eps stuff was yanked as we could not do a good job without full access to font metrics. 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.

-p
Post by Kwok, Marcus B.
Hello,
I am programmatically generating an EPS file using GMT, and then converting it to PNG using ghostscript. However, when I use ps2raster, part of the file gets cut off.
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 bottom 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.
pscoast -R-180.0/180.0/-60.0/90.0 -B30g15/30g15 --PLOT_DEGREE_FORMAT=dddF --DEGREE_SYMBOL=degree -JQ0.0/8.5i -G178/255/178 -S130/239/255 -Dc -W -K --PAPER_MEDIA=letter+ > test.eps
pstext classification.txt -JX8.5i/6.5i -R-4.25/4.25/0/6.5 -N -O --PAPER_MEDIA=letter+ >> test.eps
ps2raster test.eps -E72 -Qt4 -Tg
gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=png16m -r72 -dTextAlphaBits=4 -sOutputFile=gs.png -ftest.eps
-4.25 -0.5 12 0 0 TC UNCLASSIFIED
4.25 7 12 0 0 BC UNCLASSIFIED
When I run gswin32c directly, the entire image is visible, so I have a workaround in place.
I have attached my sample output (the PNG files have been rotated manually to the correct orientation, as my application handles that automatically).
I am using (an admittedly old version) GMT 4.5.2, but I don’t think it is a bug, but more so that I am doing something incorrectly when creating the file or the annotations. Is there a way to specify the BoundingBox to ps2raster?
Thanks,
Marcus
--
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)
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 ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Kwok, Marcus B.
2014-08-14 13:22:25 UTC
Permalink
OK thanks anyway! I will try upgrading.

--
Marcus Kwok <***@jhuapl.edu<mailto:***@jhuapl.edu>>
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)

From: World-Wide GMT Usage and Help Mailing List [mailto:GMT-***@lists.hawaii.edu] On Behalf Of Paul Wessel
Sent: Wednesday, August 13, 2014 18:12
To: GMT-***@lists.hawaii.edu
Subject: Re: [GMT-HELP] Help with ps2raster Cutting Off Image

Cannot really reproduce this since 4.5.2 was some time ago. The eps stuff was yanked as we could not do a good job without full access to font metrics. 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.

-p

On Aug 13, 2014, at 11:05 AM, Kwok, Marcus B. <***@JHUAPL.EDU<mailto:***@JHUAPL.EDU>> wrote:


Hello,
I am programmatically generating an EPS file using GMT, and then converting it to PNG using ghostscript. However, when I use ps2raster, part of the file gets cut off.

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 bottom 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.

pscoast -R-180.0/180.0/-60.0/90.0 -B30g15/30g15 --PLOT_DEGREE_FORMAT=dddF --DEGREE_SYMBOL=degree -JQ0.0/8.5i -G178/255/178 -S130/239/255 -Dc -W -K --PAPER_MEDIA=letter+ > test.eps

pstext classification.txt -JX8.5i/6.5i -R-4.25/4.25/0/6.5 -N -O --PAPER_MEDIA=letter+ >> test.eps

ps2raster test.eps -E72 -Qt4 -Tg

gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=png16m -r72 -dTextAlphaBits=4 -sOutputFile=gs.png -ftest.eps

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

When I run gswin32c directly, the entire image is visible, so I have a workaround in place.

I have attached my sample output (the PNG files have been rotated manually to the correct orientation, as my application handles that automatically).

I am using (an admittedly old version) GMT 4.5.2, but I don't think it is a bug, but more so that I am doing something incorrectly when creating the file or the annotations. Is there a way to specify the BoundingBox to ps2raster?

Thanks,
Marcus

--
Marcus Kwok <***@jhuapl.edu<mailto:***@jhuapl.edu>>
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)

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<http://gmt.soest.hawaii.edu> To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu<mailto:***@lists.hawaii.edu> Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu<http://gmt.soest.hawaii.edu> instead. <test.eps><test.png><gs.png>

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 ***@lists.hawaii.edu<mailto:***@lists.hawaii.edu> 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 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 ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Kwok, Marcus B.
2014-08-18 16:33:58 UTC
Permalink
So, I have upgraded to GMT 4.5.12 and switched to using PAPER_MEDIA=letter 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 problems dealing with spaces in the path as long as the filenames are quoted (so my current workaround still works). Would it be possible to get this added to ps2raster?

--
Marcus Kwok <***@jhuapl.edu<mailto:***@jhuapl.edu>>
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)

From: World-Wide GMT Usage and Help Mailing List [mailto:GMT-***@lists.hawaii.edu] On Behalf Of Paul Wessel
Sent: Wednesday, August 13, 2014 18:12
To: GMT-***@lists.hawaii.edu
Subject: Re: [GMT-HELP] Help with ps2raster Cutting Off Image

Cannot really reproduce this since 4.5.2 was some time ago. The eps stuff was yanked as we could not do a good job without full access to font metrics. 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.

-p

On Aug 13, 2014, at 11:05 AM, Kwok, Marcus B. <***@JHUAPL.EDU<mailto:***@JHUAPL.EDU>> wrote:


Hello,
I am programmatically generating an EPS file using GMT, and then converting it to PNG using ghostscript. However, when I use ps2raster, part of the file gets cut off.

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 bottom 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.

pscoast -R-180.0/180.0/-60.0/90.0 -B30g15/30g15 --PLOT_DEGREE_FORMAT=dddF --DEGREE_SYMBOL=degree -JQ0.0/8.5i -G178/255/178 -S130/239/255 -Dc -W -K --PAPER_MEDIA=letter+ > test.eps

pstext classification.txt -JX8.5i/6.5i -R-4.25/4.25/0/6.5 -N -O --PAPER_MEDIA=letter+ >> test.eps

ps2raster test.eps -E72 -Qt4 -Tg

gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=png16m -r72 -dTextAlphaBits=4 -sOutputFile=gs.png -ftest.eps

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

When I run gswin32c directly, the entire image is visible, so I have a workaround in place.

I have attached my sample output (the PNG files have been rotated manually to the correct orientation, as my application handles that automatically).

I am using (an admittedly old version) GMT 4.5.2, but I don't think it is a bug, but more so that I am doing something incorrectly when creating the file or the annotations. Is there a way to specify the BoundingBox to ps2raster?

Thanks,
Marcus

--
Marcus Kwok <***@jhuapl.edu<mailto:***@jhuapl.edu>>
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)

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<http://gmt.soest.hawaii.edu> To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu<mailto:***@lists.hawaii.edu> Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu<http://gmt.soest.hawaii.edu> instead. <test.eps><test.png><gs.png>

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 ***@lists.hawaii.edu<mailto:***@lists.hawaii.edu> 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 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 ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Paul Wessel
2014-08-18 17:30:32 UTC
Permalink
Thanks Marcus-

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).

-p
Post by Kwok, Marcus B.
So, I have upgraded to GMT 4.5.12 and switched to using PAPER_MEDIA=letter 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 problems dealing with spaces in the path as long as the filenames are quoted (so my current workaround still works). Would it be possible to get this added to ps2raster?
--
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)
Sent: Wednesday, August 13, 2014 18:12
Subject: Re: [GMT-HELP] Help with ps2raster Cutting Off Image
Cannot really reproduce this since 4.5.2 was some time ago. The eps stuff was yanked as we could not do a good job without full access to font metrics. 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.
-p
Hello,
I am programmatically generating an EPS file using GMT, and then converting it to PNG using ghostscript. However, when I use ps2raster, part of the file gets cut off.
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 bottom 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.
pscoast -R-180.0/180.0/-60.0/90.0 -B30g15/30g15 --PLOT_DEGREE_FORMAT=dddF --DEGREE_SYMBOL=degree -JQ0.0/8.5i -G178/255/178 -S130/239/255 -Dc -W -K --PAPER_MEDIA=letter+ > test.eps
pstext classification.txt -JX8.5i/6.5i -R-4.25/4.25/0/6.5 -N -O --PAPER_MEDIA=letter+ >> test.eps
ps2raster test.eps -E72 -Qt4 -Tg
gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=png16m -r72 -dTextAlphaBits=4 -sOutputFile=gs.png -ftest.eps
-4.25 -0.5 12 0 0 TC UNCLASSIFIED
4.25 7 12 0 0 BC UNCLASSIFIED
When I run gswin32c directly, the entire image is visible, so I have a workaround in place.
I have attached my sample output (the PNG files have been rotated manually to the correct orientation, as my application handles that automatically).
I am using (an admittedly old version) GMT 4.5.2, but I don’t think it is a bug, but more so that I am doing something incorrectly when creating the file or the annotations. Is there a way to specify the BoundingBox to ps2raster?
Thanks,
Marcus
--
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)
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 ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Kwok, Marcus B.
2014-08-18 17:42:57 UTC
Permalink
Great, thanks!
--
Marcus Kwok <***@jhuapl.edu>
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)

-----Original Message-----
From: World-Wide GMT Usage and Help Mailing List [mailto:GMT-***@lists.hawaii.edu] On Behalf Of Paul Wessel
Sent: Monday, August 18, 2014 13:31
To: GMT-***@lists.hawaii.edu
Subject: Re: [GMT-HELP] Help with ps2raster Cutting Off Image

Thanks Marcus-

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).

-p
Post by Kwok, Marcus B.
So, I have upgraded to GMT 4.5.12 and switched to using PAPER_MEDIA=letter 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 problems dealing with spaces in the path as long as the filenames are quoted (so my current workaround still works). Would it be possible to get this added to ps2raster?
--
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)
From: World-Wide GMT Usage and Help Mailing List
Sent: Wednesday, August 13, 2014 18:12
Subject: Re: [GMT-HELP] Help with ps2raster Cutting Off Image
Cannot really reproduce this since 4.5.2 was some time ago. The eps stuff was yanked as we could not do a good job without full access to font metrics. 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.
-p
Hello,
I am programmatically generating an EPS file using GMT, and then converting it to PNG using ghostscript. However, when I use ps2raster, part of the file gets cut off.
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 bottom 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.
pscoast -R-180.0/180.0/-60.0/90.0 -B30g15/30g15
--PLOT_DEGREE_FORMAT=dddF --DEGREE_SYMBOL=degree -JQ0.0/8.5i
-G178/255/178 -S130/239/255 -Dc -W -K --PAPER_MEDIA=letter+ > test.eps
pstext classification.txt -JX8.5i/6.5i -R-4.25/4.25/0/6.5 -N -O
--PAPER_MEDIA=letter+ >> test.eps
ps2raster test.eps -E72 -Qt4 -Tg
gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=png16m -r72 -dTextAlphaBits=4
-sOutputFile=gs.png -ftest.eps
-4.25 -0.5 12 0 0 TC UNCLASSIFIED
4.25 7 12 0 0 BC UNCLASSIFIED
When I run gswin32c directly, the entire image is visible, so I have a workaround in place.
I have attached my sample output (the PNG files have been rotated manually to the correct orientation, as my application handles that automatically).
I am using (an admittedly old version) GMT 4.5.2, but I don't think it is a bug, but more so that I am doing something incorrectly when creating the file or the annotations. Is there a way to specify the BoundingBox to ps2raster?
Thanks,
Marcus
--
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)
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
obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu
instead. <test.eps><test.png><gs.png>
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 ***@lists.hawaii.edu
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 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 ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Kwok, Marcus B.
2014-08-26 15:28:26 UTC
Permalink
Hi Paul,
I am unable to test the SVN version, but looking at the SVN log, I see that 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 issue?

Thanks,
Marcus
--
Marcus Kwok <***@jhuapl.edu>
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)


-----Original Message-----
From: World-Wide GMT Usage and Help Mailing List [mailto:GMT-***@lists.hawaii.edu] On Behalf Of Paul Wessel
Sent: Monday, August 18, 2014 13:31
To: GMT-***@lists.hawaii.edu
Subject: Re: [GMT-HELP] Help with ps2raster Cutting Off Image

Thanks Marcus-

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).

-p
Post by Kwok, Marcus B.
So, I have upgraded to GMT 4.5.12 and switched to using PAPER_MEDIA=letter 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 problems dealing with spaces in the path as long as the filenames are quoted (so my current workaround still works). Would it be possible to get this added to ps2raster?
--
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)
From: World-Wide GMT Usage and Help Mailing List
Sent: Wednesday, August 13, 2014 18:12
Subject: Re: [GMT-HELP] Help with ps2raster Cutting Off Image
Cannot really reproduce this since 4.5.2 was some time ago. The eps stuff was yanked as we could not do a good job without full access to font metrics. 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.
-p
Hello,
I am programmatically generating an EPS file using GMT, and then converting it to PNG using ghostscript. However, when I use ps2raster, part of the file gets cut off.
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 bottom 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.
pscoast -R-180.0/180.0/-60.0/90.0 -B30g15/30g15
--PLOT_DEGREE_FORMAT=dddF --DEGREE_SYMBOL=degree -JQ0.0/8.5i
-G178/255/178 -S130/239/255 -Dc -W -K --PAPER_MEDIA=letter+ > test.eps
pstext classification.txt -JX8.5i/6.5i -R-4.25/4.25/0/6.5 -N -O
--PAPER_MEDIA=letter+ >> test.eps
ps2raster test.eps -E72 -Qt4 -Tg
gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=png16m -r72 -dTextAlphaBits=4
-sOutputFile=gs.png -ftest.eps
-4.25 -0.5 12 0 0 TC UNCLASSIFIED
4.25 7 12 0 0 BC UNCLASSIFIED
When I run gswin32c directly, the entire image is visible, so I have a workaround in place.
I have attached my sample output (the PNG files have been rotated manually to the correct orientation, as my application handles that automatically).
I am using (an admittedly old version) GMT 4.5.2, but I don't think it is a bug, but more so that I am doing something incorrectly when creating the file or the annotations. Is there a way to specify the BoundingBox to ps2raster?
Thanks,
Marcus
--
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)
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
obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu
instead. <test.eps><test.png><gs.png>
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 ***@lists.hawaii.edu
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 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 ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Paul Wessel
2014-08-26 16:41:27 UTC
Permalink
It was changed to double quotes for windows last week.
Paul

Sent from my iPad
Post by Kwok, Marcus B.
Hi Paul,
I am unable to test the SVN version, but looking at the SVN log, I see that 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 issue?
Thanks,
Marcus
--
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)
-----Original Message-----
Sent: Monday, August 18, 2014 13:31
Subject: Re: [GMT-HELP] Help with ps2raster Cutting Off Image
Thanks Marcus-
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).
-p
Post by Kwok, Marcus B.
So, I have upgraded to GMT 4.5.12 and switched to using PAPER_MEDIA=letter 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 problems dealing with spaces in the path as long as the filenames are quoted (so my current workaround still works). Would it be possible to get this added to ps2raster?
--
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)
From: World-Wide GMT Usage and Help Mailing List
Sent: Wednesday, August 13, 2014 18:12
Subject: Re: [GMT-HELP] Help with ps2raster Cutting Off Image
Cannot really reproduce this since 4.5.2 was some time ago. The eps stuff was yanked as we could not do a good job without full access to font metrics. 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.
-p
Hello,
I am programmatically generating an EPS file using GMT, and then converting it to PNG using ghostscript. However, when I use ps2raster, part of the file gets cut off.
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 bottom 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.
pscoast -R-180.0/180.0/-60.0/90.0 -B30g15/30g15
--PLOT_DEGREE_FORMAT=dddF --DEGREE_SYMBOL=degree -JQ0.0/8.5i
-G178/255/178 -S130/239/255 -Dc -W -K --PAPER_MEDIA=letter+ > test.eps
pstext classification.txt -JX8.5i/6.5i -R-4.25/4.25/0/6.5 -N -O
--PAPER_MEDIA=letter+ >> test.eps
ps2raster test.eps -E72 -Qt4 -Tg
gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=png16m -r72 -dTextAlphaBits=4
-sOutputFile=gs.png -ftest.eps
-4.25 -0.5 12 0 0 TC UNCLASSIFIED
4.25 7 12 0 0 BC UNCLASSIFIED
When I run gswin32c directly, the entire image is visible, so I have a workaround in place.
I have attached my sample output (the PNG files have been rotated manually to the correct orientation, as my application handles that automatically).
I am using (an admittedly old version) GMT 4.5.2, but I don't think it is a bug, but more so that I am doing something incorrectly when creating the file or the annotations. Is there a way to specify the BoundingBox to ps2raster?
Thanks,
Marcus
--
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)
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
obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu
instead. <test.eps><test.png><gs.png>
Mailing list for GMT discussions of all kinds. If you are not sure you have found a bug, discuss it here first.
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 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
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 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 ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Kwok, Marcus B.
2014-08-26 16:50:27 UTC
Permalink
I see it now, thanks!
--
Marcus Kwok <***@jhuapl.edu>
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)


-----Original Message-----
From: World-Wide GMT Usage and Help Mailing List [mailto:GMT-***@lists.hawaii.edu] On Behalf Of Paul Wessel
Sent: Tuesday, August 26, 2014 12:41
To: GMT-***@lists.hawaii.edu
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
Post by Kwok, Marcus B.
Hi Paul,
I am unable to test the SVN version, but looking at the SVN log, I see that 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 issue?
Thanks,
Marcus
--
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)
-----Original Message-----
From: World-Wide GMT Usage and Help Mailing List
Sent: Monday, August 18, 2014 13:31
Subject: Re: [GMT-HELP] Help with ps2raster Cutting Off Image
Thanks Marcus-
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).
-p
Post by Kwok, Marcus B.
So, I have upgraded to GMT 4.5.12 and switched to using PAPER_MEDIA=letter 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 problems dealing with spaces in the path as long as the filenames are quoted (so my current workaround still works). Would it be possible to get this added to ps2raster?
--
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)
From: World-Wide GMT Usage and Help Mailing List
Sent: Wednesday, August 13, 2014 18:12
Subject: Re: [GMT-HELP] Help with ps2raster Cutting Off Image
Cannot really reproduce this since 4.5.2 was some time ago. The eps stuff was yanked as we could not do a good job without full access to font metrics. 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.
-p
Hello,
I am programmatically generating an EPS file using GMT, and then converting it to PNG using ghostscript. However, when I use ps2raster, part of the file gets cut off.
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 bottom 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.
pscoast -R-180.0/180.0/-60.0/90.0 -B30g15/30g15
--PLOT_DEGREE_FORMAT=dddF --DEGREE_SYMBOL=degree -JQ0.0/8.5i
-G178/255/178 -S130/239/255 -Dc -W -K --PAPER_MEDIA=letter+ >
test.eps
pstext classification.txt -JX8.5i/6.5i -R-4.25/4.25/0/6.5 -N -O
--PAPER_MEDIA=letter+ >> test.eps
ps2raster test.eps -E72 -Qt4 -Tg
gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=png16m -r72 -dTextAlphaBits=4
-sOutputFile=gs.png -ftest.eps
-4.25 -0.5 12 0 0 TC UNCLASSIFIED
4.25 7 12 0 0 BC UNCLASSIFIED
When I run gswin32c directly, the entire image is visible, so I have a workaround in place.
I have attached my sample output (the PNG files have been rotated manually to the correct orientation, as my application handles that automatically).
I am using (an admittedly old version) GMT 4.5.2, but I don't think it is a bug, but more so that I am doing something incorrectly when creating the file or the annotations. Is there a way to specify the BoundingBox to ps2raster?
Thanks,
Marcus
--
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)
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
obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu
instead. <test.eps><test.png><gs.png>
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
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 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
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 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 ***@lists.hawaii.edu
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 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 ***@lists.hawaii.edu
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
Loading...