You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Difference between begin and psconvert for pngs #8979
There is a difference between some of the option flags in gmt begin and gmt psconvert.
Full script that generated the error
#!/bin/bash
gmt begin test ps,png E720 -C
gmt basemap -R-2/2/-2/2 -JX5i/5i -BNSEW -Bpxa1 -Bpya1 -Xc -Y3.25i
gmt end show
gmt psconvert test.ps -A -I+m0.1i -Tg -E720
rm -f gmt.conf gmt.history
The above will generate a png that has a page border of 0.1i, while putting the psconvert flags in the options in begin will result in a full size page png.
#!/bin/bash
gmt begin test ps,png A,E720,-I+m0.1i -C
gmt basemap -R-2/2/-2/2 -JX5i/5i -BNSEW -Bpxa1 -Bpya1 -Xc -Y3.25i
gmt end show
rm -f gmt.conf gmt.history
Expected outcome
I would have expected gmt begin test ps,png A,E720,-I+m0.1i -C to produce a png that has a proper bounding box size in accordance with the -A and -I flags, but it only works when psconvert is called later. In either case, the bounding box resize only applies to the png and not the ps.
There is something wrong indeed, but not what it looks on first look.
In either case, the bounding box resize only applies to the png and not the ps.
Well, up to GMT 6.6 (exclusive) the ps file was never changed by psconvert, only a copy of it when the EPS driver is selected. On 6.6 a new -! option changed that, but it's currently failing also in this case. The failure seems to be related to the inability to update the new BoundingBox (the shift to LL corner of the page is working ok).
If you use
gmt begin test eps,png A,E720,I+m0.1i -C ,
you'll see what I mean and you can also see that the png version is fine. If you swap the order of formats (e.g., png,eps) it displays the correct png, but the eps is still incorrect.
Activity
mkononets commentedon Apr 15, 2026
See there's no dash before A and E720? Remove the dash before
I, then it'll work.mkononets commentedon Apr 15, 2026
(meaning the topic is not a bug but a user typo)
ESaltPi commentedon Apr 15, 2026
Alas, the typo and user error was in me typing it into the bug report. It still doesnt work.
joa-quim commentedon Apr 16, 2026
There is something wrong indeed, but not what it looks on first look.
Well, up to GMT 6.6 (exclusive) the ps file was never changed by
psconvert, only a copy of it when theEPSdriver is selected. On 6.6 a new-!option changed that, but it's currently failing also in this case. The failure seems to be related to the inability to update the new BoundingBox (the shift to LL corner of the page is working ok).If you use
gmt begin test eps,png A,E720,I+m0.1i -C,you'll see what I mean and you can also see that the png version is fine. If you swap the order of formats (e.g.,
png,eps) it displays the correct png, but theepsis still incorrect.joa-quim commentedon Apr 20, 2026
This issue was fixed in master (issue #8992)
Let PS format be also _cropable_ from modern mode scripts. (GenericMa…