From 9c1b4277504a4ad65fd6705ffbf1089af28b322d Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Fri, 28 Feb 2014 01:06:15 -0500 Subject: serve jpeg images --- web/main.py | 6 +++--- web/templates/index.html | 2 +- 2 files changed, 4 insertions(+), 4 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__': diff --git a/web/templates/index.html b/web/templates/index.html index a3dec33..b3b5fe0 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -2,7 +2,7 @@ {% block main %}
- +
{% for id, coords in areas %} {% end %} -- cgit v1.2.3-70-g09d2