mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 01:34:24 +03:00
Initialise object when unpickling
This commit is contained in:
parent
e4185694a2
commit
6802c12f89
|
@ -585,9 +585,16 @@ class Image:
|
||||||
return [self.mode, self.size, self.tobytes()]
|
return [self.mode, self.size, self.tobytes()]
|
||||||
|
|
||||||
def __setstate__(self, state):
|
def __setstate__(self, state):
|
||||||
|
self.category = NORMAL
|
||||||
|
self.info = {}
|
||||||
|
self.palette = None
|
||||||
|
self.pyaccess = None
|
||||||
|
self.readonly = 0
|
||||||
|
self.tile = []
|
||||||
mode, size, data = state
|
mode, size, data = state
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
self.size = size
|
self.size = size
|
||||||
|
self.im = core.new(mode, size)
|
||||||
self.frombytes(data)
|
self.frombytes(data)
|
||||||
|
|
||||||
def tobytes(self, encoder_name="raw", *args):
|
def tobytes(self, encoder_name="raw", *args):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user