Support webp in _get_mime_type_for_image
untested
This commit is contained in:
parent
1ac432d9f0
commit
c30b016bb5
@ -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')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user