Drop dynamic source replacement to match actual client sizes, as the quality
loss from downsizing a _larger_ image is minimal.
Originally introduced in lijtweg commit
v2.5-7-gcd93e774e6 (2017-10-11)
[foto: replace justified thumbnails by height-optimised versions]
with visible improvements probably due to using the target size of 200px
without adjusting for up to 1.25x enlargement to fit.
Testing originals of 250px on modern browsers with (bilinear) rescaling
is hard to distinguish (not significantly more blurry) and depends on only
a single thumbnail resolution to be created for significantly reduced
resource requirements. May be slightly larger on average, but likely much
smaller without reloads and considering caching opportunities.
targetRowHeight: 200,
};
var layout = require('justified-layout')(ratios, config);
- var thumbreplace = !/[?&]blur\b/.test(window.location.search);
gallery.style.position = 'relative';
gallery.style.height = layout.containerHeight + 'px';
imgel.style.position = 'absolute';
imgel.style.top = layout.boxes[i].top + 'px';
imgel.style.left = layout.boxes[i].left + 'px';
-
- 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;
- };
- }
- }
})();
}
};
{
// assume all album entries are symlinks to archive originals
$target = preg_replace('{^(\.\./)*}', '', readlink($path));
- $thumb = 'thumb/200/' . $target;
+ $thumb = 'thumb/250/' . $target;
@list ($order, $size, $title) = explode(':', pathinfo($path, PATHINFO_FILENAME), 3);
$imgtag = 'img src="/'.$thumb.'"';