[cairo] cairo Digest, Vol 52, Issue 21

Simon Bächler sbaechler at me.com
Mon Nov 16 07:49:42 PST 2009


Hi Gerdus

No. It crashes as well.
But I found a workaround. It's not that great but at least it stops 
crashing.

I added the following two lines:

self.basename=self.basename.decode("unicode_escape","ignore")
self.basename=self.basename.encode("ascii","ignore")

self.surface2.write_to_png(self.basename)

Now special characters are just left out which is sad. Apparently the 
function cannot deal with those.

Regards
Simon

> ------------------------------
>
> Message: 2
> Date: Sun, 15 Nov 2009 13:22:23 +0200
> From: Gerdus van Zyl <gerdusvanzyl at gmail.com>
> Subject: Re: [cairo] PyCairo crashes
> To: cairo at cairographics.org
> Message-ID:
> 	<91882ea90911150322r1a0147a0u265e30b196bb050c at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> The line
> self.surface2 =
> cairo.ImageSurface.create_for_data(self.surface,cairo.FORMAT_ARGB32,
> self.width, self.height, stride)
> is very suspect since the first argument isn't a surface but a buffer/data.
>
> Does it work if you just use self.surface.write_to_png(self.basename)?
>
> 2009/11/15 Simon B?chler <sbaechler at me.com>:



More information about the cairo mailing list