mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-14 19:36:38 +03:00
Convert unsupported WebP mode to RGB as .convert supports more src modes
This commit is contained in:
parent
0704367952
commit
f3edf52900
|
@ -246,7 +246,7 @@ def _save_all(im, fp, filename):
|
||||||
if ims.mode not in _VALID_WEBP_MODES:
|
if ims.mode not in _VALID_WEBP_MODES:
|
||||||
alpha = 'A' in ims.mode or 'a' in ims.mode \
|
alpha = 'A' in ims.mode or 'a' in ims.mode \
|
||||||
or (ims.mode == 'P' and 'A' in ims.im.getpalettemode())
|
or (ims.mode == 'P' and 'A' in ims.im.getpalettemode())
|
||||||
rawmode = 'RGBA' if alpha else 'RGBX'
|
rawmode = 'RGBA' if alpha else 'RGB'
|
||||||
frame = ims.convert(rawmode)
|
frame = ims.convert(rawmode)
|
||||||
|
|
||||||
if rawmode == 'RGB':
|
if rawmode == 'RGB':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user