Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- print imghdr.what(image_file.getvalue())
- print imghdr.what(None, image_file.getvalue())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement