Move to an elif clause of the if in line 778, as it's just another combination of mode,self.mode under the master transparency condition

This commit is contained in:
hugovk 2014-05-19 10:04:56 +03:00
parent a59bc40c38
commit 0938145e57

View File

@ -802,7 +802,8 @@ class Image:
# after quantization.
trns_im = trns_im.convert('RGB')
trns = trns_im.getpixel((0,0))
elif self.mode == 'P' and mode == 'RGBA' and 'transparency' in self.info:
delete_trns = True
if mode == "P" and palette == ADAPTIVE:
im = self.im.quantize(colors)
@ -837,9 +838,6 @@ class Image:
except KeyError:
raise ValueError("illegal conversion")
if self.mode == 'P' and mode == 'RGBA' and 'transparency' in self.info:
delete_trns = True
new_im = self._new(im)
if delete_trns:
#crash fail if we leave a bytes transparency in an rgb/l mode.