From: Mischa POSLAWSKY Date: Tue, 19 Jun 2018 11:10:26 +0000 (+0200) Subject: foto: ?blur option to disable thumbnail resizing X-Git-Tag: v3.3~20 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/ee09c737f25b21db46ed1105a407f2a1ee14cd44 foto: ?blur option to disable thumbnail resizing --- diff --git a/foto/album.inc.php b/foto/album.inc.php index 5e1a148..9410083 100644 --- a/foto/album.inc.php +++ b/foto/album.inc.php @@ -74,6 +74,7 @@ function imgjustify() { targetRowHeight: 200, }; var layout = require('justified-layout')(ratios, config); + var thumbreplace = !window.location.search.test(/[?&]blur\b/); gallery.style.position = 'relative'; gallery.style.height = layout.containerHeight + 'px'; @@ -86,16 +87,18 @@ function imgjustify() { imgel.style.top = layout.boxes[i].top + 'px'; imgel.style.left = layout.boxes[i].left + 'px'; - var thumbtarget = imgel.src.replace(/(\/thumb\/)\d+/, '$1'+layout.boxes[i].height) - if (imgel.complete) { - imgel.src = thumbtarget; - } - else if (thumbtarget != imgel.src) { - var loadthumb = new Image(); - loadthumb.src = thumbtarget; - loadthumb.onload = function() { - imgel.src = this.src; - }; + if (thumbreplace) { + var thumbtarget = imgel.src.replace(/(\/thumb\/)\d+/, '$1'+layout.boxes[i].height) + if (imgel.complete) { + imgel.src = thumbtarget; + } + else if (thumbtarget != imgel.src) { + var loadthumb = new Image(); + loadthumb.src = thumbtarget; + loadthumb.onload = function() { + imgel.src = this.src; + }; + } } })(); }