Fix saving images with added transparency

See http://mail.python.org/pipermail/image-sig/1999-February/000648.html
This patch was carried by fedora for python-imaging
This commit is contained in:
Sandro Mani 2013-02-06 00:49:26 +01:00
parent 8fc5fbc6c1
commit cc439099c1

View File

@ -364,6 +364,11 @@ def getheader(im, palette=None, info=None):
for i in range(maxcolor):
s.append(o8(i) * 3)
if im.info.has_key('transparency'):
transparentIndex = im.info['transparency']
s.append('!' + o8(0xf9) + o8(4) + o8(1) + o8(0) + o8(0) +
o8(transparentIndex) + o8(0))
return s
def getdata(im, offset = (0, 0), **params):