Bug 697419

Summary: Regression in ps2epsi
Product: Ghostscript Reporter: Emily Ratliff <emily.ratliff>
Component: RegressionAssignee: Default assignee <ghostpdl-bugs>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P4    
Version: master   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---
Attachments: reproducer for the regression is ps2epsi
drawing.epsi

Description Emily Ratliff 2016-12-05 08:15:39 UTC
Created attachment 13214 [details]
reproducer for the regression is ps2epsi

David Annetts reported a regression to Ubuntu which is also present in master and is exhibited by the attached file, kindly provided by David. The bug is https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/1647276
Comment 1 Ray Johnston 2016-12-05 17:40:22 UTC
This bug is incomplete and invalid.

First, I tested against gs 9.18 and the output is identical to that of the
latest (9.20) release.

The ubuntu bug report states "This means that I am unable to convert from a ps to a PDF and have the correct (tight) bounding box."

Ghostscript ps2pdfwr only creates a MediaBox defined by the page size. The 
drawing.ps file provided performs the following to set the pagesize:

%%PageBoundingBox: 52 5 575 668
596 842 cairo_set_page_size
%%EndPageSetup
q 52 5 523 663 rectclip q

Note that the "rectclip" values exactly match the bounding box given in the
%%PageBoundingBox DSC comment (not that DSC comments are really anything more
that just documentation or comments to a PostScript interpreter such as gs)

The resulting PDF _does_ reflect the "rectclip" seen in the page Contents:

q 0.1 0 0 0.1 0 0 cm
/R7 gs
q
520 50 5230 6630 re W n

(the gs pdfwrite device operates with a 720 dpi resolution and the "re W"
corresponds to "rectclip" of PostScript)

Please re-open with a Ghostscript command line that fails with the attached
file. I suspect the problem is NOT with Ghostscript, but with Cairo or with
some ubuntu speecific modification to canonical Ghostscript (the version that
Artifex maintains and releases)

Closing as INVALID (no command line given and WORKSFORME).
Comment 2 Emily Ratliff 2016-12-06 07:23:21 UTC
Sorry for the missing details. The command line is 

$ ps2epsi drawing.ps

and the regression is seen in git master not in 9.20 nor 9.18.
Comment 3 Ken Sharp 2016-12-06 07:41:13 UTC
(In reply to Emily Ratliff from comment #2)
> Sorry for the missing details. The command line is 
> 
> $ ps2epsi drawing.ps

That's a script rather than a Ghostscript command line, can you reproduce this using Ghostscript itself ?

I've checked the output of eps2write with the supplied file and I can see no difference (other than the date/time stamps) in the output of 9.19, 9.20 and master.

What precise difference do you see ?
Comment 4 Ray Johnston 2016-12-06 13:23:47 UTC
Created attachment 13220 [details]
drawing.epsi

still WORKSFORME.

The attached file has a reasonable BBox, so if something else is happening,
it is probably user error.

In the future, try to be more descriptive about what the problem is and what
the command line is.
Comment 5 Ken Sharp 2016-12-06 13:28:09 UTC
Just for completeness; I've run the file through ps2epsi on a Fedora system, the output from 9.16 and 9.20 differ only in the colour of a few pixels in the preview image, I suspect these are unused padding bits.

The comments, bounding boxes and marking content of the output EPSI file are absolutely identical.

So, still not seeing any problem, and we've done our best to reproduce it. If you still think there is a problem then you're going to have to tell us what we have to do to reproduce it. You should definitely check that you are using *our* canonical source, straight from our Git repository, without using shared libraries. Otherwise you are testing something different to us, and something which we do not supply.
Comment 6 Emily Ratliff 2016-12-07 08:49:15 UTC
This was my mistake. I didn't realize or notice that ps2epsi is a script and was calling out to the ghostscript executable on the system rather than the executable built by the code that I pulled from your git repo. I have released updated packages which should solve the problem on Ubuntu. I apologize for wasting your time here. Thanks for checking and double checking.
Comment 7 Ray Johnston 2016-12-07 10:29:35 UTC
Thanks, Emily, for the confirmation that it isn't our problem.