Convert was passing in a 3tuple to putpixel for a P image

This commit is contained in:
wiredfool 2016-01-14 08:58:13 -08:00
parent 5ff9f24fcc
commit a098c88509

View File

@ -875,6 +875,12 @@ class Image(object):
trns_im = Image()._new(core.new(self.mode, (1, 1)))
if self.mode == 'P':
trns_im.putpalette(self.palette)
if type(t) == tuple:
try:
t = trns_im.palette.getcolor(t)
except:
raise ValueError("Couldn't allocate a palette "+
"color for transparency")
trns_im.putpixel((0, 0), t)
if mode in ('L', 'RGB'):