use direct io for mastodon images

workspace
Brendan Howell 7 years ago
parent 97023f4e5a
commit 5ab819f2cb

@ -303,7 +303,7 @@ class PublicRelations(Bureau):
filename = "/tmp/" + filename filename = "/tmp/" + filename
print("fetching", img.remote_url, filename) print("fetching", img.remote_url, filename)
req_data = requests.get(img.url) req_data = requests.get(img.url)
im = PIL.Image.open(io.BytesIO(filename)) im = PIL.Image.open(io.StringIO(filename))
if im.mode in ("L", "RGB", "P"): if im.mode in ("L", "RGB", "P"):
im = PIL.ImageOps.equalize(im) im = PIL.ImageOps.equalize(im)
im.thumbnail((576, 576), PIL.Image.ANTIALIAS) im.thumbnail((576, 576), PIL.Image.ANTIALIAS)

Loading…
Cancel
Save