Cropping to the bounding box of an EPSF file doesn't seem to work if the bounding box is in the trailer (e.g., in a file made using Grace/Xmgr). The appropriate bounding box parsing code seems to be in lib/gs_epsf.ps but as I'm no whiz at PostScript I've been unable to fix this locally. GSView deals with cropping in its own way. Hope this makes sense. David
We'll need the EPS file in question as well as the Ghostscript commandline that you are using in order to reproduce this problem. Please attach them.
Created attachment 1187 [details] An EPS file made using xmgr/Grace with bounding box (atend) The command line used to convert is the following "C:\Program Files\Ghostscript\gs8.15\bin\gswin32c" -sDEVICE=png16m -dEPSCrop -sOutputFile=t2.png -- "t2.eps" Hope this helps David
This appears to be legal EPS and we would need to search for the %%Trailer: comment. If the file is not positionable, then we would need to copy the input to a temp file so we can position to the end and search for the Trailer and BBox data. We are marking this bountiable.
Ghostgum pointed out that this limitation is documented in Use.htm
I'm working on a solution to this. Current implementation peeks for %%BoundingBox in the first 1000 bytes. If found, it assumes that %%BoundingBox is in the header and uses current code. Otherwise, it copies the EPS to a temporary file while parsing for DSC comments. At the end, it will grab the correct %%BoundingBox (either head or trailer as per DSC specification) and use that. The PS interface to the DSC parser appears to require an additional operator to copy information from the DSC struture to the DSC dictionary.
Fix submitted to code review http://ghostscript.com/pipermail/gs-code-review/2005-April/004771.html
*** Bug 690034 has been marked as a duplicate of this bug. ***
There is no activity on this bug. The code was not reviewed, and will no longer apply due to a patch to fix another bug (ignored HiResBoundingBox). Note that the fix below made it trivial to handle HiResBoundingBox correctly.
Reassigning to Alex to fix (possibly by fixing the patch from Russell).
Bug still reproducible in Ghostscript 9.03
I'm closing this due to lack of activity, and because Russell says his patch won't work (comment #8). I can't identify which other change caused it not to work. My apologies to Russell that this was allowed to go unreviewed for so long that it became unusable.