aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/main.py6
-rw-r--r--web/templates/index.html2
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 %}
<div id="image_container">
- <img id="page" src="{{page_number}}.png" usemap="#wordmap" />
+ <img id="page" src="{{page_number}}.jpg" usemap="#wordmap" />
</div>
<map name="wordmap">{% for id, coords in areas %}
<area href="#" shape="rect" coords="{{coords}}" data-id="{{id}}" />{% end %}