mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +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)
|
fp.write("# Mode: %s\n" % self.mode)
|
||||||
for i in range(256):
|
for i in range(256):
|
||||||
fp.write("%d" % i)
|
fp.write("%d" % i)
|
||||||
for j in range(i, len(self.palette), 256):
|
for j in range(i*3, i*3+3):
|
||||||
|
try:
|
||||||
fp.write(" %d" % self.palette[j])
|
fp.write(" %d" % self.palette[j])
|
||||||
|
except IndexError:
|
||||||
|
fp.write(" 0")
|
||||||
fp.write("\n")
|
fp.write("\n")
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user