Convert unsupported WebP mode to RGB as .convert supports more src modes

This commit is contained in:
Konstantin Kopachev 2018-09-04 11:00:29 -07:00
parent 0704367952
commit f3edf52900
No known key found for this signature in database
GPG Key ID: CECF757E656F4F62

View File

@ -246,7 +246,7 @@ def _save_all(im, fp, filename):
if ims.mode not in _VALID_WEBP_MODES:
alpha = 'A' in ims.mode or 'a' in ims.mode \
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)
if rawmode == 'RGB':