Support webp in _get_mime_type_for_image

untested
This commit is contained in:
khazhyk 2018-11-23 19:45:12 -08:00 committed by Rapptz
parent 1ac432d9f0
commit c30b016bb5

View File

@ -252,6 +252,8 @@ def _get_mime_type_for_image(data):
return 'image/jpeg'
elif data.startswith(b'\x47\x49\x46\x38\x37\x61') or data.startswith(b'\x47\x49\x46\x38\x39\x61'):
return 'image/gif'
elif data.startswith(b'RIFF') and data[8:12] == b'WEBP':
return 'image/webp'
else:
raise InvalidArgument('Unsupported image type given')