When unpickling, only put palette if there is one

This commit is contained in:
hugovk 2015-01-30 14:04:35 +02:00
parent 7823197fdd
commit 0f89322216

View File

@ -625,7 +625,7 @@ class Image:
self.mode = mode self.mode = mode
self.size = size self.size = size
self.im = core.new(mode, size) self.im = core.new(mode, size)
if mode in ("L", "P"): if mode in ("L", "P") and palette:
self.putpalette(palette) self.putpalette(palette)
self.frombytes(data) self.frombytes(data)