I'm saving the PIL image to a io.BytesIO() object.
imgByteArr = io.BytesIO()
img.save(imgByteArr, format=format)
Then trying to return the image to the user.
return send_file(img.getvalue(), mimetype="image/" + img_details["ext"].lower())
But I'm getting the error
TypeError: The view function did not return a valid response. The function either returned None or ended without a return statement.
I dont want to send as an attachment, i want the image to be displayed on the page.
Does any one know if it is possible without saving to disk first?
I was missing "seek"
This now works.