mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-27 16:33:15 +03:00
Simplified code
This commit is contained in:
parent
99e401123b
commit
5d4fbdfab4
|
@ -194,9 +194,9 @@ def _save(im, fp, filename):
|
||||||
|
|
||||||
if colormaptype:
|
if colormaptype:
|
||||||
palette = im.im.getpalette("RGB", "BGR")
|
palette = im.im.getpalette("RGB", "BGR")
|
||||||
colormapfirst, colormaplength, colormapentry = 0, len(palette) // 3, 24
|
colormaplength, colormapentry = len(palette) // 3, 24
|
||||||
else:
|
else:
|
||||||
colormapfirst, colormaplength, colormapentry = 0, 0, 0
|
colormaplength, colormapentry = 0, 0
|
||||||
|
|
||||||
if im.mode in ("LA", "RGBA"):
|
if im.mode in ("LA", "RGBA"):
|
||||||
flags = 8
|
flags = 8
|
||||||
|
@ -211,7 +211,7 @@ def _save(im, fp, filename):
|
||||||
o8(id_len)
|
o8(id_len)
|
||||||
+ o8(colormaptype)
|
+ o8(colormaptype)
|
||||||
+ o8(imagetype)
|
+ o8(imagetype)
|
||||||
+ o16(colormapfirst)
|
+ o16(0) # colormapfirst
|
||||||
+ o16(colormaplength)
|
+ o16(colormaplength)
|
||||||
+ o8(colormapentry)
|
+ o8(colormapentry)
|
||||||
+ o16(0)
|
+ o16(0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user