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