Importing EPS Clips Image

Bug #471199 reported by Julian Robbins
This bug report is a duplicate of:  Bug #649842: import from EPS ignores bounding box. Edit Remove
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Undecided
Unassigned

Bug Description

When using Inkscape 0.47pre4 on Windows XP, I import an EPS file, attached and unfortunately Inkscape clips off the right hand side of the image when imported. Apart from that the image looks ok, but obviously this is an annoying issue.

The file itself is slightly odd, as the logo appears in a viewer to be right on the right hand side of the page rather than with a smaller bounding box it really requires.

Using all defaults on import

Tags: importing eps
Revision history for this message
Julian Robbins (joolsr) wrote :
Revision history for this message
Julian Robbins (joolsr) wrote :

I should add that the image preview before importing also shows the logo clipped with the right hand edge missing

Revision history for this message
Julian Robbins (joolsr) wrote :

If I use ps2pdf on cmd line I get same result, so it may be a fault in that. Using -sPAPERSIZE=a3 makes the paper size bigger enough to allow the image to print out ok

Revision history for this message
su_v (suv-lp) wrote :

related to or duplicate of bug #264044 “inkscape19770 import/open eps clips drawings larger than sheet width”:
<https://bugs.launchpad.net/inkscape/+bug/264044>

tags: added: eps importing
Revision history for this message
su_v (suv-lp) wrote :

reproduced with Inkscape 0.46+devel r22547 on OS X 10.5.8, poppler 0.11.1, ghostscript 8.70

Changed in inkscape:
status: New → Confirmed
Revision history for this message
Julian Robbins (joolsr) wrote :

Still a problem in 0.47 ...

Revision history for this message
su_v (suv-lp) wrote :

related:
bug #505991 "import ps: bad paper format"
<https://bugs.launchpad.net/inkscape/+bug/505991>
bug #190424 "Problems importing EPS", comment #25
<https://bugs.launchpad.net/inkscape/+bug/190424>

and from a discussion on InkscapeForum.com by sas:
«As I've pointed out on Launchpad, the things that are omitted when opening in Inkscape are outside the bounding box of the EPS file, so it seems reasonable for them to be discarded - they are not part of the EPS image itself, just extraneous junk.

You can make Inkscape import everything in the EPS file by editing ps2pdf-ext.py (in the Inkscape extensions directory) so that the -dEPSFitPage option is used when calling ps2pdf. However, this would mean that an EPS file opened in Inkscape would have the wrong page size in many cases, so it would not be a good thing to do in general.»
<http://www.inkscapeforum.com/viewtopic.php?f=5&t=797&start=25#p19617>

Revision history for this message
Ricardo Graça (devius) wrote :

So I tried to edit the "ps2pdf-ext.py" script and, since there was no specific instruction on how to actually edit it on the previous post, I just placed the "-dEPSFitPage" argument after the first occurrence of the "ps2pdf" command resulting in a line that reads as:

run('ps2pdf -dEPSFitPage "%s" "%%s"' % sys.argv[1].replace("%","%%"), "ps2pdf")

After this, the preview on the import dialog showed the correct image, without clipping, but when I clicked OK the program crashed. I edited the file with nano. Strangely even after I removed the new argument the program still crashed, although the preview showed the incorrectly clipped image as was expected. Now I can't import .pdf or .eps/.ps files. Can anyone please explain the proper procedure to fix this bug?

Revision history for this message
su_v (suv-lp) wrote :

> Can anyone please explain the proper procedure to fix this bug?
The bug is not fixed - the comments discuss ideas what causes the unexpected cropping and possible workarounds but AFAICT there is no known 'proper procedure to fix this bug'.

> After this, the preview on the import dialog showed the
> correct image, without clipping, but when I clicked OK the program crashed.

Any related console messages when the crash happens?

> Now I can't import .pdf or .eps/.ps files.

I have no idea what went wrong when you edited the python script - does it still have the correct permissions (ownership, executable)? You could try to replace your edited file with the original version from the 0.47 release branch: click on the link "download file" on this page: <http://bazaar.launchpad.net/~inkscape.dev/inkscape/RELEASE_0_47_BRANCH/annotate/head:/share/extensions/ps2pdf-ext.py>, save it and copy it to the shared extensions directory.

Revision history for this message
Ricardo Graça (devius) wrote :

The only message that appeared was this (with and without the -dEPSFitPage argument):

inkscape: symbol lookup error: inkscape: undefined symbol: _ZN13GfxColorSpace5parseEP6Object

Ownership and permissions are all right and the same as all the other scripts in there. The only difference is the date. This is getting very weird. I downloaded the script from the link you provided and didn't make a difference. Still crashing. I did try to open other EPS files and noticed that the ones who don't have data outside the standard page (US Letter?) size don't crash inkscape. I'll try the good old method of removing and reinstalling inkscape and ghostscript to see if it helps. I also found that this is probably a ghostscript bug and it's been around for at least 3 years - http://opendevice.blogspot.com/2007/05/eps-to-pdf-how-to-avoid-clipping.html.

Revision history for this message
su_v (suv-lp) wrote :

> inkscape: undefined symbol: _ZN13GfxColorSpace5parseEP6Object

This error is not related to your editing of the extension script. Did you at the same time update the poppler libraries on your system? Your version of Inkscape was compiled with Poppler <= 0.12.1 but your system currently has Poppler >= 0.12.2 (most likely 0.12.4 or even 0.14). You need to get a newer version of Inkscape compiled with the same version of poppler as you have installed (this is a problem of the your linux distributor) or recompile Inkscape yourself with the currently installed poppler libs and headers.

See also <https://bugs.launchpad.net/inkscape/+bug/258504/comments/24> and bug #548746 “Crash on pdf import, openSUSE 11.2” (Note: there is some internal discussion going on if #258504 and #548746 are duplicates, but not about the cause of the crash and error message you see when importing PDF files when having a newer poppler version installed than the one Inkscape was built and linked with)

Revision history for this message
Praetor77 (geramses) wrote :

I just wanted to comment that changing:

run('ps2pdf "%s" "%%s"' % sys.argv[1].replace("%","%%"), "ps2pdf")
to
run('ps2pdf -dEPSFitPage "%s" "%%s"' % sys.argv[1].replace("%","%%"), "ps2pdf")

in /usr/share/inkscape/extensions/ps2pdf-ext.py

fixed this EXTREMLY annoying bug for me. I experienced the inadequate import of eps files in both 0.47 and 0.48+devel r8974.

Revision history for this message
su_v (suv-lp) wrote :

The proposed solution from Bug #649842 in Inkscape: “import from EPS ignores bounding box” also works with the sample file attached in comment #1: the complete content of the EPS file is imported without any cropping or clipping.

'-dEPSCrop' instead of '-dEPSFitpage' keeps the original size of the EPS file instead of resizing it to fit on the default papersize (US Letter Portrait).

Revision history for this message
launchpad@russellengland.com (a-launchpad-russellengland-com) wrote :

Brilliant! #12 worked for me

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.