Kwok, Marcus B.
2014-08-13 21:05:02 UTC
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.
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.