aboutsummaryrefslogtreecommitdiffstats
path: root/web/main.py
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2014-02-28 01:06:15 -0500
committerGuillaume Horel <guillaume.horel@gmail.com>2014-02-28 01:06:15 -0500
commit9c1b4277504a4ad65fd6705ffbf1089af28b322d (patch)
tree400b957fef3c7ab18382a6f0f4eb45942b4f0a84 /web/main.py
parentebd5024ec7e47ac85a41bf4d1ff98df15eb8cac3 (diff)
downloadocr-layer-curation-9c1b4277504a4ad65fd6705ffbf1089af28b322d.tar.gz
serve jpeg images
Diffstat (limited to 'web/main.py')
-rw-r--r--web/main.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/web/main.py b/web/main.py
index 81e8252..b93f2e4 100644
--- a/web/main.py
+++ b/web/main.py
@@ -17,16 +17,16 @@ class ImageHandler(RequestHandler):
def get(self, page_number):
im = image_from_book("../Villiers_de_L'Isle-Adam_-_Tribulat_Bonhomet,_1908.djvu", int(page_number))
- self.set_header('Content-Type', 'image/png')
+ self.set_header('Content-Type', 'image/jpg')
img_buff = io.BytesIO()
- im.save(img_buff, format="PNG")
+ im.save(img_buff, format="JPEG")
img_buff.seek(0)
self.write(img_buff.read())
self.finish()
application = Application([
(r'/(\d+)/?', MainHandler),
- (r'/(\d+)\.png/?', ImageHandler)]
+ (r'/(\d+)\.jpg/?', ImageHandler)]
, **settings)
if __name__ == '__main__':