don't create a new palette on Image._new if one already exists (i.e. after im.copy())

This commit is contained in:
David Schmidt 2013-11-12 14:41:35 +01:00
parent ac25dab915
commit 06301c9eba

View File

@ -475,7 +475,7 @@ class Image:
new.mode = im.mode
new.size = im.size
new.palette = self.palette
if im.mode == "P":
if im.mode == "P" and not new.palette:
from PIL import ImagePalette
new.palette = ImagePalette.ImagePalette()
try: