Re: Bug: ps2eps 1.70 generates incorrectly quoted Ghostscript -c argument on Windows
Shyam Sundar <[email protected]> Tue, 28 Jul 2026 20:41:09 +0530
| Newsgroups | gmane.comp.tex.live |
|---|---|
| Message-ID | <CAKfuAf4Ai6C--8QyZw-VH1Ls5pMO2PWXy2L4wXX3U-r8P1QqZw@mail.gmail.com> |
--000000000000bd6a7b0657ad41fc Content-Type: multipart/alternative; boundary="000000000000bd6a7a0657ad41fa" --000000000000bd6a7a0657ad41fa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attaching the postscript file mentioned in the bug. On Tue, Jul 28, 2026 at 8:38=E2=80=AFPM Shyam Sundar <[email protected]> w= rote: > *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=3Dbbox test-ps-5.ps > > and correctly returns a bounding box. > > *Workaround:* > > In ps2eps.pl, changing: > > $translatecmd=3D"-c \'$translation\'"; > > *to:* > > $translatecmd=3D"-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' > --000000000000bd6a7a0657ad41fa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Attaching the postscript file mentioned in the bug.</div><= br><div class=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr" class= =3D"gmail_attr">On Tue, Jul 28, 2026 at 8:38=E2=80=AFPM Shyam Sundar <<a= href=3D"mailto:[email protected]">[email protected]</a>> wrote:<br></= div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bor= der-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><p><= strong>Environment:</strong><span aria-hidden=3D"true"></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" target=3D"_bla= nk">test-ps-5.ps</a></div><div><br></div><div>The debug output contains:</d= iv><div><br></div><div>Calling: gswin32c ... -c '63 63 translate' -= f "<a href=3D"http://test-ps-5.ps" target=3D"_blank">test-ps-5.ps</a>&= quot; -c quit</div><div><br></div><div><b>Running Ghostscript directly work= s:</b></div><div><br></div><div>gswin32c -dBATCH -dNOPAUSE -sDEVICE=3Dbbox = <a href=3D"http://test-ps-5.ps" target=3D"_blank">test-ps-5.ps</a></div><di= v><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"backg= round-color:transparent">In </span><code style=3D"background-color:transpar= ent"><a href=3D"http://ps2eps.pl" target=3D"_blank">ps2eps.pl</a></code><sp= an style=3D"background-color:transparent">, changing:</span><br></div><div>= <span style=3D"background-color:transparent"><br></span></div><div>$transla= tecmd=3D"-c \'$translation\'";<span style=3D"background-c= olor: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 quote= s to double quotes. The same change is required at both occurrences in the = script. (around lines 533 and 633)</div><div><p><strong>Expected behavior:<= /strong><span aria-hidden=3D"true"></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> </blockquote></div> --000000000000bd6a7a0657ad41fa-- --000000000000bd6a7b0657ad41fc Content-Type: application/postscript; name="test-ps-5.ps" Content-Disposition: attachment; filename="test-ps-5.ps" Content-Transfer-Encoding: base64 Content-ID: <f_ms4smku60> X-Attachment-Id: f_ms4smku60 JSFQUy1BZG9iZS0zLjAgRVBTRi0zLjANCiUlQm91bmRpbmdCb3g6IC02Mi41IC02Mi41IDYyLjUg NjIuNQ0KL2EgMjUgZGVmIC9tYSBhIG5lZyBkZWYNCi9oYSBhIDIgZGl2IGRlZiAvbWhhIGhhIG5l ZyBkZWYNCi9xYSBoYSAyIGRpdiBkZWYgL21xYSBxYSBuZWcgZGVmDQovbGx7Z3NhdmUgcWEgbXFh IG1vdmV0bw0KbXFhIG1xYSBsaW5ldG8NCm1xYSBxYSBsaW5ldG8gY2xvc2VwYXRoIGZpbGwNCnFh IG1xYSBtb3ZldG8NCnFhIHFhIGxpbmV0bw0KbXFhIHFhIGxpbmV0byBzdHJva2UNCmdyZXN0b3Jl DQp9ZGVmDQovbHJ7Z3NhdmUgOTAgcm90YXRlIGxsIGdyZXN0b3JlfWRlZg0KL3Vye2dzYXZlIDE4 MCByb3RhdGUgbGwgZ3Jlc3RvcmV9ZGVmDQovdWx7Z3NhdmUgLTkwIHJvdGF0ZSBsbCBncmVzdG9y ZX1kZWYNCi90aWxle2dzYXZlIG1xYSBxYSB0cmFuc2xhdGUgbGwgZ3Jlc3RvcmUNCmdzYXZlIG1x YSBtcWEgdHJhbnNsYXRlIHVyIGdyZXN0b3JlDQpnc2F2ZSBxYSBtcWEgdHJhbnNsYXRlIGxyIGdy ZXN0b3JlDQpnc2F2ZSBxYSBxYSB0cmFuc2xhdGUgdWwgZ3Jlc3RvcmUNCn1kZWYNCm1hIGEgYXsv aSBleGNoIGRlZg0KbWEgYSBhey9qIGV4Y2ggZGVmDQpnc2F2ZSBpIGogdHJhbnNsYXRlIHRpbGUg Z3Jlc3RvcmUNCn1mb3J9Zm9yICVzaG93cGFnZQ== --000000000000bd6a7b0657ad41fc--