mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Match real palette format in ImagePalette.save()
This commit is contained in:
parent
a8cfe52a0b
commit
e9821edd94
|
@ -101,8 +101,11 @@ class ImagePalette:
|
|||
fp.write("# Mode: %s\n" % self.mode)
|
||||
for i in range(256):
|
||||
fp.write("%d" % i)
|
||||
for j in range(i, len(self.palette), 256):
|
||||
fp.write(" %d" % self.palette[j])
|
||||
for j in range(i*3, i*3+3):
|
||||
try:
|
||||
fp.write(" %d" % self.palette[j])
|
||||
except IndexError:
|
||||
fp.write(" 0")
|
||||
fp.write("\n")
|
||||
fp.close()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user