Make bytePalette read-only buffer

This commit is contained in:
Sandro Mani 2013-08-28 20:44:27 +02:00
parent 2ec21cf5ae
commit 1c4734b6bb

View File

@ -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()