From: Fredrik Tolf Date: Wed, 15 May 2013 20:53:24 +0000 (+0200) Subject: Use a PixbufLoader to load image data. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=04f773e3923930aa517e196962e4304eecabd1ce;p=automanga.git Use a PixbufLoader to load image data. --- diff --git a/manga/reader.py b/manga/reader.py index 73b6bd4..ca8f433 100644 --- a/manga/reader.py +++ b/manga/reader.py @@ -1,4 +1,4 @@ -import threading, gtk, gio, gobject +import threading, gtk, gobject import lib, profile class notdone(Exception): pass @@ -75,7 +75,7 @@ class imgload(future): self.start() def value(self): - buf = bytearray() + buf = gtk.gdk.PixbufLoader() with self.page.open() as st: self.p = 0 self.st = st @@ -84,14 +84,11 @@ class imgload(future): if read == "": break self.p += len(read) - buf.extend(read) + buf.write(read) self.progcb() self.st = None - with gtk.gdk.lock: - try: - return gtk.gdk.pixbuf_new_from_stream(gio.memory_input_stream_new_from_data(str(buf))) - finally: - gtk.gdk.flush() + buf.close() + return buf.get_pixbuf() @property def prog(self):