mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Allow uploading of GIFs for users.
Discord Nitro accounts can upload GIFs as avatars, so the image mimetype checker code should check for the GIF magic number too. Signed-off-by: SunDwarf <l@veriny.tf>
This commit is contained in:
parent
d13df30e2a
commit
e7c5ef181f
@ -246,6 +246,8 @@ def _get_mime_type_for_image(data):
|
||||
return 'image/png'
|
||||
elif data.startswith(b'\xFF\xD8') and data.endswith(b'\xFF\xD9'):
|
||||
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'
|
||||
else:
|
||||
raise InvalidArgument('Unsupported image type given')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user