Error "Inkscape encountered an internal error and will close now" when opening eps from gnuplot.

Bug #498814 reported by EddieRiggs
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Unassigned

Bug Description

I've started using Inkscape with my previous duo of LaTeX and gnuplot, as I could create vector graphics with floating text quite easily.

However, I had hoped to be able to edit my gnuplot output with Inkscape, to add LaTeX text or equations, etc. However, when opening the eps from gnuplot, Inkscape gives the error "Inkscape encountered an internal error and will close now." I do have ps2pdf and everything, and it is called by Inkscape (though I don't know where the output goes), but Inkscape crashes.

I also have PDF versions of these files, produced by ps2pdf, from LaTeX compile time. Opening these in Inkscape causes it to choke directly (e.g., no delay and no Python shell) with the same error.

Platform: Windows XP SP3
Inkscape version: 0.47

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

not reproduced with Inkscape 0.47 r22583 on OS X 10.5.8, gs 8.70
(Inkscape 0.47 uses ps2pdf as well, see eps_input.inx and ps2pdf-ext.py in share/extensions)

Revision history for this message
EddieRiggs (eddieriggs) wrote :

Some details I forgot.

Ghostscript. The version I have installed is 8.64. I didn't realize there was a newer release; for some reason it doesn't show on the first Google result, but I grabbed a Windows binary from SourceForge. After uninstall.reinstall/reboot, I'll give it a shot.

Extensions. I have TeXtext installed. I used the installation instructions (written for Inkscape 0.46...) found here at http://www.elisanet.fi/ptvirtan/software/textext/index.html. TeXtext/Inkscape worked fine in documents I created new in Inkscape. As a result of those instructions, I have pstoedit 3.50 installed. Having pstoedit and ps2pdf seems redundant?

Revision history for this message
EddieRiggs (eddieriggs) wrote :

Update.

Installed Ghostscript 8.70. Same problem occurs. Tried converting the eps to pdf on a website I found suggested somewhere here on Launchpad, no luck. I selected PDF v1.4 as I noticed this is what Inkscape seems to use.

Interestingly, an eps I create with Inkscape can be opened by Inkscape. It successfully converts to PDF, then brings up some options for opening PDFs. I went to google and found some other .eps files to try; some succeed, some fail.

Success:
http://www.brandsoftheworld.com/logocontest/brands/637.eps
http://www.miaeyc.com/images/Big_Apple.eps
http://tctransfer.com/Transfer/EcoLab/TCell_Refills/4870158_E003694_Apple_Spice_Case_724289_8800_Rev02.eps
http://genomebiology.com/content/download/figures/gb-2004-5-11-248-2.EPS
http://www1.cs.columbia.edu/~jwgu/figs/apple.eps

Fail:
http://www1.cs.columbia.edu/~jwgu/figs/apple.eps
http://graphics.stanford.edu/papers/bucket_render/paper_all.eps

I don't know enough to be able to pick out the differences.

Revision history for this message
Alvin Penner (apenner) wrote :

cannot reproduce the crash using Windows XP, Inkscape 0.47 and Ghostscript 8.64.

have you tried using ps2pdf from DOS to see if it works?
If I run the DOS command:
C:\WINDOWS\Temp>ps2pdf plot_malus.ps plot_malus.pdf

then I get the attached result, which looks reasonable.

Revision history for this message
Alvin Penner (apenner) wrote :

I would suggest trying to trap the exit messages that are generated using the method outlined at :
http://kaioa.com/node/63
this will require running a small program called Inkscapec.exe from a DOS prompt in the same directory where Inkscape is.

Revision history for this message
EddieRiggs (eddieriggs) wrote :

ps2pdf works. I know this, as LaTeX uses it to generate pdf of my gnuplot eps for PDFLatex. Running it manually, I get a reasonable looking PDF output.

Converting the eps file with inkscapec:
C:\Program Files\Inkscape\> inkscapec.exe -e C:\plot_malus.pdf C:\plot_malus.eps
** Message: Found local interpreter, 'C:\Program Files\Inkscape\python\pythonw.exe', size: 24576
Background RRGGBBAA: ffffff00
Area: 0:0:765:990 exported to 765 x 990 pixels (90 dpi)
Bitmap saved as: C:\plot_malus.pdf

Opening this file, however, generates an error in Adobe Reader 9, as well as gsview.

Running inkscapec on the output from ps2pdf produces the following output. I just ran inkscapec then used the GUI to open the file.
C:\Program Files\Inkscape\> inkscapec.exe

(inkscape.exe:2092): Gtk-WARNING **: Could not find the icon 'object-visible'. The 'hicolor' theme was not found either, perhaps you need to install it. You can get a copy from: http://icon-theme.freedesktop.org/releases

And then it returns to a live prompt - inkscapec is gone, the error message from my first post is produced, and the Windows error reporting dialog appears. The file generated by ps2pdf is viewable in Adobe Reader, gsview, and can be compiled into a PDF via LaTeX and pdflatex.

Revision history for this message
Alvin Penner (apenner) wrote :

could you attach the .pdf file that is causing the crash?

Revision history for this message
EddieRiggs (eddieriggs) wrote :

Sure, here it is.

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

it's a PNG file, not a PDF - rename it and it will open in your image viewer. From the man page for inkscape:

 -e, --export-png=FILENAME
 -A, --export-pdf=FILENAME

<http://inkscape.modevia.com/inkscape-man.html>

Revision history for this message
EddieRiggs (eddieriggs) wrote :

Right you are, interesting that I was seeing calls to ps2pdf and ps2pdfxx during its creation.

Run with the proper commandline switch, I do get a PDF output, readable by Adobe Reader, gsview, and Inkscape. The filesize is larger than that produced by Alvin, see the attached file.

So: why does Inkscape choke on the file Alvin Penner attached? Why does it choke given the eps input, but not on all eps as I listed above? If the manual conversion worked using Inkscape from the commandline, why does Inkscape choke when doing it from the GUI and on the PDF created with ps2pdf manually?

And if I run the conversion with inkscapec on the commandline, using the PDF generated by ps2pdf (which matches the size of Alvin's file), the conversion proceeds successfully and generates a file that is exactly identical to what inkscapec gives with the eps input.

This really isn't a huge problem for me, as I'm generally making my gnuplot stuff with a batch script anyway; it's trivial to add a couple lines to convert all the generated files to PDF via inkscapec. But it would be nice not to have to remember to do that for any eps file I want to edit.

Thanks for all the help, guys.

Revision history for this message
Alvin Penner (apenner) wrote :

could you perhaps clarify as to what is the problem?

I have just loaded plot_malus.pdf and plot_malus_inkscapec.pdf into Inkscape and they both load normally.
Has this issue been resolved for you?

Revision history for this message
EddieRiggs (eddieriggs) wrote :

It hasn't been resolved, but if you're importing files that are giving me errors, it seems more like a problem with my install, and not Inkscape. I'll work on uninstalling everything and getting a fresh install over my holiday break to see if it helps.

Revision history for this message
EddieRiggs (eddieriggs) wrote :

Hi guys,

I'm back at it. I've had mixed success with Inkscape over the past few months - usually things worked, other times I found workarounds.

But today, it's like I ran into a wall again. I still often work with Inkscape to touch up gnuplot output or incorporate it in other designs. However, Inkscape can't open simple test-cases of gnuplot output right now.

I've reinstalled Inkscape - 0.47-3, released Novemeber 2009. I'm now running GhostScript 8.71. Gnuplot is at 4.4.0.

Basically, I set gnuplot to output an eps file. GSview open this file fine, and output looks reasonable. Inkscape crashes. I convert the eps file to pdf with epstopdf; output looks reasonable. Opening this with Inkscape causes Inkscape to crash. Convert the eps to pdf with inkscapec, no error is produced, and the resulting file does *not* crash Inkscape if I open it up to edit.

Can anyone explain this behavior? I guess I can try running every file that crashes Inkscape thorugh inkscapec, but this could become a real pain.

The attached files - test.plt is gnuplot commands, test.eps is gnuplot output, test.pdf is epstopdf output, test-inkscape.pdf is inkscapec output.

Thanks again.?field.comment=Hi guys,

I'm back at it. I've had mixed success with Inkscape over the past few months - usually things worked, other times I found workarounds.

But today, it's like I ran into a wall again. I still often work with Inkscape to touch up gnuplot output or incorporate it in other designs. However, Inkscape can't open simple test-cases of gnuplot output right now.

I've reinstalled Inkscape - 0.47-3, released Novemeber 2009. I'm now running GhostScript 8.71. Gnuplot is at 4.4.0.

Basically, I set gnuplot to output an eps file. GSview open this file fine, and output looks reasonable. Inkscape crashes. I convert the eps file to pdf with epstopdf; output looks reasonable. Opening this with Inkscape causes Inkscape to crash. Convert the eps to pdf with inkscapec, no error is produced, and the resulting file does *not* crash Inkscape if I open it up to edit.

Can anyone explain this behavior? I guess I can try running every file that crashes Inkscape thorugh inkscapec, but this could become a real pain.

Thanks again.

Revision history for this message
EddieRiggs (eddieriggs) wrote :
Revision history for this message
EddieRiggs (eddieriggs) wrote :
Revision history for this message
Alvin Penner (apenner) wrote :

the file test.ps opens normally for me on Windows XP and Inkscape 0.47. Could you indicate where the crash is occurring?
- do you get the temporary black DOS popup window that indicates that a Python script is running?
- do you get the preview window that says "PDF Import Settings"
- do you get any exit messages in DOS? To trap the exit messages you will need to go to a DOS prompt in the Inkscape directory and run inkscapec.exe, which in turn will start Inkscape, and then you can load the .ps file to see if exit messages are generated.

for example, what you should normally see is the DOS message:
** Message: Found local interpreter, 'D:\Program Files\Inkscape\python\pythonw.exe', Size: 24576

this message is normal, do you get any other messages besides this?

Revision history for this message
EddieRiggs (eddieriggs) wrote :

For the eps file:

- The Python shell does open.
- It doesn't make it to any import settings. Instead, an error message appears saying "Inkscape encountered an internal error and will close now." I hit OK, then the Windows error reporting dialog appears.
- No output other than what you indicate is shows up on the console.

For the epstopdf-converted pdf:

- The Python shell does *not* open.
- Instead, the dialog with the error ""Inkscape encountered an internal error and will close now" displays almost immediately, after which the Windows error reporting dialog appears.
- Nothing makes it to the console before it closes, not even the message about finding an appropriate interpreter. However, opening the inkscapec-generated PDF also does not display this message, so my guess is that pdf is handled more natively by Inkscape components, whereas the eps requires some Python glue to help Inkscape out.
- At any rate, the import settings dialog doesn't appear before Inkscape crashes.

To add to the confusion: when upgrading to gnuplot 4.4.0, I'd forgotten that I now can generate PDF straight from gnuplot. This can be done with the PDF terminal, which uses Ghostscript I'd guess, or the pdfcairo terminal, which uses cairo. Both of these open in Inkscape.

If any of you are familiar with gnuplot, below are the plot commands I used to set up the output and generate the plot.

set xrange [0:2*pi]
set samples 1000
set term postscript eps enhanced solid color
set output "test.eps"
plot sin(x)
set term pdfcairo enhanced solid color
set output "test-gpdfcairo.pdf"
plot sin(x)
set term pdf enhanced solid color
set output "test-gpdf.pdf"
plot sin(x)

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

@EddieRiggs - do you still experience the same problems opening EPS files with the current stable release (0.48) or a recent development build from <http://inkscape.modevia.com/win32/?C=M;O=D>?

Changed in inkscape:
status: New → Incomplete
importance: Undecided → High
Revision history for this message
EddieRiggs (eddieriggs) wrote :

Wasn't aware 0.48 had been released.

Uninstalled the 0.47 this morning, deleted most everything that the uninstaller didn't get, and installed 0.48. I *no longer* have this issue.

Thanks!

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

Thank you for testing and reporting back. Closing as 'Fix Released' for now - please reopen it if the error reoccurs with the current stable release or a more recent development build.

Changed in inkscape:
milestone: none → 0.48
status: Incomplete → Fix Released
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.