From 0f8932221642efc325e5155eee857c0b057c9d31 Mon Sep 17 00:00:00 2001 From: hugovk Date: Fri, 30 Jan 2015 14:04:35 +0200 Subject: [PATCH] When unpickling, only put palette if there is one --- PIL/Image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/Image.py b/PIL/Image.py index 66149e320..63ef2cd96 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -625,7 +625,7 @@ class Image: self.mode = mode self.size = size self.im = core.new(mode, size) - if mode in ("L", "P"): + if mode in ("L", "P") and palette: self.putpalette(palette) self.frombytes(data)