aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkhazhyk <[email protected]>2018-11-23 19:45:12 -0800
committerRapptz <[email protected]>2018-11-24 23:18:11 -0500
commitc30b016bb52b46bf34d53eef2a6710d46780dfff (patch)
treea0e3ea2f790df6aae516024c838c5eacc935c246
parentAdd Guild.default_notifications (diff)
downloaddiscord.py-c30b016bb52b46bf34d53eef2a6710d46780dfff.tar.xz
discord.py-c30b016bb52b46bf34d53eef2a6710d46780dfff.zip
Support webp in _get_mime_type_for_image
untested
-rw-r--r--discord/utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/discord/utils.py b/discord/utils.py
index 3be410be..f7a57fab 100644
--- a/discord/utils.py
+++ b/discord/utils.py
@@ -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')