I found out how to use PIL to get the image dimensions, but not the file size in bytes. I need to know the file size to decide if the file is too big to be uploaded to the d
I'm a bit late to this, but I came across this question 5 mins ago when searching how to get the size of a PIL image without saving it to disk. In case anyone else comes across this, this is a simple way of doing it:
import StringIO
output = StringIO.StringIO()
image_output.save(output, 'PNG') #a format needs to be provided
contents = output.getvalue()
output.close()
image_filesize = len(contents)