Limit image size also in HTML.

This commit is contained in:
Bastian Kleineidam 2013-12-10 19:59:19 +01:00
parent c3078ed855
commit 5ad423c15e

View file

@ -182,11 +182,15 @@ class HtmlEventHandler(EventHandler):
"""Write HTML entry for downloaded comic."""
if self.lastComic != comic.name:
self.newComic(comic)
size = getDimensionForImage(filename, MaxImageSize)
imageUrl = self.getUrlFromFilename(filename)
pageUrl = comic.referrer
if pageUrl != self.lastUrl:
self.html.write(u'<li><a href="%s">%s</a>\n' % (pageUrl, pageUrl))
self.html.write(u'<br/><img src="%s"/>\n' % imageUrl)
self.html.write(u'<br/><img src="%s"' % imageUrl)
if size:
self.html.write(' width="%d" height="%d"' % size)
self.html.write('/>\n')
if text:
self.html.write(u'<br/>%s\n' % text)
self.lastComic = comic.name