Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
15 lines (12 sloc) 271 Bytes
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from PIL import Image
import StringIO
import re
import tornado.escape
def type_of(content):
try:
i=Image.open(StringIO.StringIO(content))
return i.format.lower()
except IOError:
return False