From 1c4734b6bbd68c2731534ddae615c7d4335769e1 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Wed, 28 Aug 2013 20:44:27 +0200 Subject: [PATCH] Make bytePalette read-only buffer --- PIL/Image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/Image.py b/PIL/Image.py index 794ee4913..72d15e236 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -718,7 +718,7 @@ class Image: if self.mode == "L" and mode == "RGBA" and "transparency" in self.info: from PIL import ImagePalette self.mode = "P" - bytePalette = bytearray([i//3 for i in range(768)]) + bytePalette = bytes(bytearray([i//3 for i in range(768)])) self.palette = ImagePalette.raw("RGB", bytePalette) self.palette.dirty = 1 self.load()