From b5cb43d34dda1ed5a6bc590e6f35c80a0f3a11ec Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Mon, 30 Apr 2018 04:10:16 +0200 Subject: [PATCH] try using a bytestream --- screenless/bureau/publicrelations/publicrelations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/screenless/bureau/publicrelations/publicrelations.py b/screenless/bureau/publicrelations/publicrelations.py index 21d09f8..4c6cc7d 100644 --- a/screenless/bureau/publicrelations/publicrelations.py +++ b/screenless/bureau/publicrelations/publicrelations.py @@ -303,7 +303,7 @@ class PublicRelations(Bureau): #filename = "/tmp/" + filename #print("fetching", img.remote_url, filename) req_data = requests.get(img.url) - im = PIL.Image.open(io.StringIO(req_data.content)) + im = PIL.Image.open(io.BytesIO(req_data.content)) if im.mode in ("L", "RGB", "P"): im = PIL.ImageOps.equalize(im) im.thumbnail((576, 576), PIL.Image.ANTIALIAS)