mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
fixes #513
This commit is contained in:
parent
93a8bc9bd3
commit
232c175bd9
|
@ -505,7 +505,7 @@ def _save(im, fp, filename, chunk=putchunk, check=0):
|
||||||
else:
|
else:
|
||||||
# check palette contents
|
# check palette contents
|
||||||
if im.palette:
|
if im.palette:
|
||||||
colors = len(im.palette.getdata()[1])//3
|
colors = max(len(im.im.getpalette("RGB"))//3, 256)
|
||||||
else:
|
else:
|
||||||
colors = 256
|
colors = 256
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user