mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 09:14:27 +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()]
|
||||
|
||||
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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user