Bug: ps2eps 1.70 generates incorrectly quoted Ghostscript -c argument on Windows
Shyam Sundar <[email protected]> Tue, 28 Jul 2026 20:38:51 +0530
| Newsgroups | gmane.comp.tex.live |
|---|---|
| Message-ID | <CAKfuAf50cbcqRf_jHEiV7+FWRZFFSqyNQSqejLiWX_ztUHSAsw@mail.gmail.com> |
--00000000000060be510657ad39c2 Content-Type: text/plain; charset="UTF-8" *Environment:* - Windows 11 - TeX Live 2026 - ps2eps 1.70 - Ghostscript 10.07.1 *Problem:* When processing an EPS/PostScript file whose existing BoundingBox has negative coordinates, ps2eps generates a Ghostscript command containing: -c '63 63 translate' On Windows, Ghostscript 10.07.1 interprets the single quotes incorrectly and reports: Error: /undefined in '63 Consequently, ps2eps reports: Error: Could not determine bounding box! *Reproduction: * ps2eps -g -d test-ps-5.ps The debug output contains: Calling: gswin32c ... -c '63 63 translate' -f "test-ps-5.ps" -c quit *Running Ghostscript directly works:* gswin32c -dBATCH -dNOPAUSE -sDEVICE=bbox test-ps-5.ps and correctly returns a bounding box. *Workaround:* In ps2eps.pl, changing: $translatecmd="-c \'$translation\'"; *to:* $translatecmd="-c \"$translation\""; fixes the problem: that is, change escape single quotes to double quotes. The same change is required at both occurrences in the script. (around lines 533 and 633) *Expected behavior:* ps2eps should invoke Ghostscript with the translation argument correctly quoted on Windows, e.g.: -c "63 63 translate" rather than: -c '63 63 translate' --00000000000060be510657ad39c2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><p class=3D"gmail-PDq2pG_selectionAnchorContainer"><strong= >Environment:</strong><span aria-hidden=3D"true" class=3D"gmail-PDq2pG_sele= ctionAnchor"></span></p> <ul> <li> Windows 11 </li> <li> TeX Live 2026 </li> <li> ps2eps 1.70 </li> <li> Ghostscript 10.07.1</li></ul><div><strong>Problem:</strong><br> When processing an EPS/PostScript file whose existing BoundingBox has negat= ive coordinates, <code>ps2eps</code> generates a Ghostscript command contai= ning:</div><div><br></div><div>-c '63 63 translate'=C2=A0=C2=A0</di= v><div><br></div><div>On Windows, Ghostscript 10.07.1 interprets the single= quotes incorrectly and reports:</div><div><br></div><div>Error: /undefined= in '63=C2=A0=C2=A0</div><div><br></div><div>Consequently, <code>ps2eps= </code> reports:</div><div><br></div><div>Error: Could not determine boundi= ng box!=C2=A0</div><div><br></div><div><b>Reproduction:=C2=A0</b></div><div= ><br></div><div>ps2eps -g -d <a href=3D"http://test-ps-5.ps">test-ps-5.ps</= a></div><div><br></div><div>The debug output contains:</div><div><br></div>= <div>Calling: gswin32c ... -c '63 63 translate' -f "<a href=3D= "http://test-ps-5.ps">test-ps-5.ps</a>" -c quit</div><div><br></div><d= iv><b>Running Ghostscript directly works:</b></div><div><br></div><div>gswi= n32c -dBATCH -dNOPAUSE -sDEVICE=3Dbbox <a href=3D"http://test-ps-5.ps">test= -ps-5.ps</a></div><div><br></div><div>and correctly returns a bounding box.= =C2=A0</div><div><br></div><div><b>Workaround:</b></div><div><br></div><div= ><span style=3D"background-color:transparent">In </span><code style=3D"back= ground-color:transparent"><a href=3D"http://ps2eps.pl">ps2eps.pl</a></code>= <span style=3D"background-color:transparent">, changing:</span><br></div><d= iv><span style=3D"background-color:transparent"><br></span></div><div>$tran= slatecmd=3D"-c \'$translation\'";<span style=3D"backgroun= d-color:transparent"></span></div><div><br></div><div><b>to:</b></div><div>= <br></div><div>$translatecmd=3D"-c \"$translation\"";</= div><div><br></div><div>fixes the problem: that is, change escape single qu= otes to double quotes. The same change is required at both occurrences in t= he script. (around lines 533 and 633)</div><div><p class=3D"gmail-PDq2pG_se= lectionAnchorContainer"><strong>Expected behavior:</strong><span aria-hidde= n=3D"true" class=3D"gmail-PDq2pG_selectionAnchor"></span></p> <p><code>ps2eps</code> should invoke Ghostscript with the translation argum= ent correctly quoted on Windows, e.g.:=C2=A0-c "63 63 translate"<= /p><p>rather than:=C2=A0</p><p>-c '63 63 translate'</p></div></div> --00000000000060be510657ad39c2--