From 9f4f40f1d0287c47f91af0346bb1ccd86f9c5d27 Mon Sep 17 00:00:00 2001 From: Stuart Longland Date: Wed, 18 Apr 2018 21:51:49 +1000 Subject: [PATCH] generator template: Pass through size, retry failures. --- tornado_gallery/static/generator.thtml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tornado_gallery/static/generator.thtml b/tornado_gallery/static/generator.thtml index ef84d0c..71148ee 100644 --- a/tornado_gallery/static/generator.thtml +++ b/tornado_gallery/static/generator.thtml @@ -86,6 +86,8 @@ body { */ return { src: curr_img.src, + width: curr_img.width, + height: curr_img.height, href: '{{site_uri}}' + gallery.name + '/' + photo @@ -105,6 +107,8 @@ body { render_img(gallery.content[i]).then(function (res) { last_img.src = res.src; + last_img.width = res.width; + last_img.height = res.height; last_lnk.href = res.href; var progress = Math.round( 100*( i + 1 ) @@ -115,6 +119,7 @@ body { next(); }).catch(function (err) { console.log('Failed request: ' + err); + setTimeout(next, 2000); }); };