When I get a binary file from server I access it via r.content
. The problem is I want to turn this binary to image and then send it to browser as below:
i = Image.open(StringIO(r.content))
But calling this would return the following error:
AttributeError('JpegImageFile instance has no __call__ method',)
or for example:
AttributeError('PngImageFile instance has no __call__ method',)
This code is from python documentation