You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PNG file correctly uploads and creates a custom emoji
Actual Results
Traceback (most recent call last):
File "/home/USR/repos/eww-bot/src/helpers.py", line 252, in emoji_list
emoji = await guild.create_custom_emoji(name="reply-continue", image=emoji_file.read())
File "/home/USR/.local/lib/python3.10/site-packages/discord/guild.py", line 3302, in create_custom_emoji
img = utils._bytes_to_base64_data(image)
File "/home/USR/.local/lib/python3.10/site-packages/discord/utils.py", line 627, in _bytes_to_base64_data
mime = _get_mime_type_for_image(data)
File "/home/USR/.local/lib/python3.10/site-packages/discord/utils.py", line 622, in _get_mime_type_for_image
raise ValueError('Unsupported image type given')
ValueError: Unsupported image type given
Intents
intents.members = True
System Information
- Python v3.10.12-final
- discord.py v2.3.2-final
- aiohttp v3.8.5
- system info: Linux 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023
Checklist
I have searched the open issues for duplicates.
I have shown the entire traceback, if possible.
I have removed my token from display, if visible.
Additional Context
the _get_mime_type_for_image method checks for data.startswith(b'\x89\x50\x4E\x47\x0D\x0A\x1A\x0A'), but my pngs start with b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR
Summary
Not recognizing PNG in create_custom_emoji
Reproduction Steps
Upload a local png file to a guild using:
Minimal Reproducible Code
Expected Results
PNG file correctly uploads and creates a custom emoji
Actual Results
Intents
intents.members = True
System Information
Checklist
Additional Context
the _get_mime_type_for_image method checks for
data.startswith(b'\x89\x50\x4E\x47\x0D\x0A\x1A\x0A')
, but my pngs start withb'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR
here is the image info:
The text was updated successfully, but these errors were encountered: