#Member.avatar to bytes for Pillow

1 messages · Page 1 of 1 (latest)

calm monolith
#

I seem to be having an issue with is. Never really worked with pillow much before today, but when I get the bytes of a member's avatar and try to pass it to pillow's Image.open() method, I get this:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

My brain is just failing me currently and not providing the solution I should probably know.

avatar_as_bytes = await interaction.author.avatar.read()
...
...
avatar = Image.open(avatar_as_bytes)
lethal swan
#

pls try now, I'm about to sleep

calm monolith
#

That makes sense .

lethal swan
#

you tried? it works?

calm monolith
#

yes.

#

Thanks, @lethal swan I knew I was missing something simple

graceful waveBOT
#
Help Thread Closed

This thread was closed. To open a new thread, view the directions in #1019642966526140566.

lethal swan
#

you're welcome

slender turtle
lethal swan
#

Gn