Skip to content
This repository

eps files stump evince #1997

Closed
WeatherGod opened this Issue May 13, 2013 · 10 comments

5 participants

Benjamin Root Michael Droettboom Phil Elson Jae-Joon Lee yichuan1118
Benjamin Root
Collaborator

From the ubuntu bug tracker: https://bugs.launchpad.net/matplotlib/+bug/1179376
+++++++++++++++++++++

In Ubuntu 13.04 I created an eps file in matplotlib and when trying to display the image with evince I get:

$ evince figure_2.eps
dictstackunderflow -4
dictstackunderflow -4

(evince:16040): EvinceDocument-CRITICAL **: ev_document_misc_pixbuf_from_surface: assertion `surface' failed

(evince:16040): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
dictstackunderflow -4

(evince:16040): EvinceDocument-CRITICAL **: ev_document_misc_pixbuf_from_surface: assertion `surface' failed

(evince:16040): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
dictstackunderflow -4

and so on, and the image is not displayed. gv displays the image but throws up an error diaglogue. This only happens with "usetex=True" set. It seems that for whatever reason an extra "end" is added to the eps file, since when I remove it everything seems to work fine. I'm not sure which package is actually responsible for the buggy behaviour - I've not seen this before and have been using the identical python code in the past with no issue.

Phil Elson
Collaborator
pelson commented May 13, 2013

@WeatherGod - do you have code to reproduce? Is this all eps files?

Phil Elson
Collaborator
pelson commented May 13, 2013

Is this all eps files?

i.e. is it a v1.3 show stopper?

Michael Droettboom
Owner
mdboom commented May 13, 2013

I can't seem to reproduce using v1.2.1, v1.2.x or master, and with evince 3.6.1 (and I don't see the double "ends" in the file that are referenced). I'll comment on the launchpad bug to see if I can get more info from the OP.

Michael Droettboom
Owner
mdboom commented May 13, 2013

I'm milestoning this as 1.3.x blocker for now just so it doesn't get lost. If it's in fact true, it's a bad one.

Michael Droettboom
Owner
mdboom commented May 20, 2013

The issue is only present when the distiller is ghostscript, but not xpdf.

It's possible, since the Ubuntu users experiencing this problem have ghostscript 9.07, and I'm on Fedora without problems and ghostscript 9.06 that this is somehow related to changes in ghostscript 9.07.

We can change the default distiller to xpdf, but will that have other implications?

@ddale, @leejjoon, @dopplershift: You guys have all had a hand in backend_ps.py. What do you think?

Jae-Joon Lee
Owner

It seems that the source of error is "pstoeps" function in backend_ps.py. gs-distiller w/ 9.07 does create correct result but pstoeps function mess this up.

In fact, with 9.07, I don't think we need to call pstoeps. The output from distiller step is already a correctly bboxed eps file. I just leave it there as I believe this is not the case for older versions of ghostscript.

My view is that the ps backend is quite complicated and prone to error with ever-evolving ghostscript. Not sure how the situation can be improved.

Michael Droettboom
Owner
mdboom commented May 21, 2013

@leejjoon: Yes -- it would be nice to reduce the dependence on specific ghostscript versions, but for now it's at least nice to have a fix. We can definitely consider making things robust over the next release cycle.

Michael Droettboom mdboom closed this May 24, 2013
Michael Droettboom
Owner
mdboom commented May 24, 2013

Closed by #2033.

yichuan1118

The patch fixed most of the problem for me.
however I still got similar problem in evince for some files

undefined -21
undefined -21

(evince:30891): EvinceDocument-CRITICAL **: ev_document_misc_pixbuf_from_surface: assertion `surface' failed

(evince:30891): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

I found that the following code is causing the problem:

plt.gca().set_xlim((-0.5,1.5))
Michael Droettboom mdboom reopened this July 01, 2013
Michael Droettboom mdboom closed this July 02, 2013
Michael Droettboom
Owner
mdboom commented July 02, 2013

@yichuan1118: Can you provide a complete and standalone example that reproduces the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.