modifié: superTornado.py

This commit is contained in:
sidya82 2014-02-28 01:44:22 +01:00
parent 17eee21632
commit 9185db9ac2

View File

@ -50,14 +50,8 @@ class VideoHandler(BaseHandler):
name = tornado.escape.xhtml_escape(self.current_user) name = tornado.escape.xhtml_escape(self.current_user)
with open("image/temp.jpg", 'rb') as f: with open("image/temp.jpg", 'rb') as f:
data = f.read() data = f.read()
qr.add_data(data) self.set_header('Content-type', 'image/jpg')
qr.make(fit=True) self.write(data)
img = qr.make_image()
self.set_header('Content-type', 'image/png')
img_buff = StringIO()
img.save(img_buff)
img_buff.seek(0)
self.write(img_buff.read())
self.finish() self.finish()
class UnauthorizedHandler(BaseHandler): class UnauthorizedHandler(BaseHandler):