How to use StringIO with imghdr to determine if valid image
I loaded a image into
image_file = StringIO(open("test.gif",'rb').read())
imghdr.what(image_file.getvalue())
print imghdr.what(image_file.getvalue())
File "/usr/lib/python2.7/imghdr.py", line 12, in what
f = open(file, 'rb')
TypeError: file() argument 1 must be encoded string without NULL bytes, not str