mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24:31 +03:00
Make bytePalette read-only buffer
This commit is contained in:
parent
2ec21cf5ae
commit
1c4734b6bb
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user