Initialise object when unpickling

This commit is contained in:
hugovk 2014-04-25 09:01:16 +03:00
parent e4185694a2
commit 6802c12f89

View File

@ -585,9 +585,16 @@ class Image:
return [self.mode, self.size, self.tobytes()]
def __setstate__(self, state):
self.category = NORMAL
self.info = {}
self.palette = None
self.pyaccess = None
self.readonly = 0
self.tile = []
mode, size, data = state
self.mode = mode
self.size = size
self.im = core.new(mode, size)
self.frombytes(data)
def tobytes(self, encoder_name="raw", *args):