Skip to content
Permalink
c9e62677ee
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
20 lines (15 sloc) 502 Bytes
from io import BytesIO
from tempfile import NamedTemporaryFile
from PIL import Image
import requests
from .service import Service, register_service
@register_service("pickle")
class PickleService(Service):
def pickle_user(self, avatar_url: str):
res = requests.get(avatar_url)
print(avatar_url)
image = Image.open(BytesIO(res.content))
image = image.rotate(180)
temp = NamedTemporaryFile()
image.save(temp, format="jpeg")
return temp