From 8b223ddfe1f1d1b0dc7239f3ae6d34a10b09230e Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Fri, 13 May 2011 15:33:18 +0200 Subject: [PATCH] epsfile: Use PIL's load() before unlinking the temp file Otherwise the image object may not have the data, and data.split() fails with AttributeError: 'NoneType' object has no attribute 'bands' --- pyx/epsfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyx/epsfile.py b/pyx/epsfile.py index 72a94065..6f1b8be8 100644 --- a/pyx/epsfile.py +++ b/pyx/epsfile.py @@ -345,6 +345,7 @@ class epsfile(canvasitem.canvasitem): f.close() c.pipeGS(fname, device="pngalpha", resolution=600) i = Image.open(fname) + i.load() os.unlink(fname) b = bitmap.bitmap_pt(self.bbox().llx_pt, self.bbox().lly_pt, i) # we slightly shift the bitmap to re-center it, as the bitmap might contain some additional border -- 2.11.4.GIT