1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Improve decoding speed

This commit is contained in:
ferferga 2020-05-25 18:31:51 +02:00
parent d7fda69e9c
commit 7587469480
2 changed files with 7 additions and 5 deletions

View file

@ -39,8 +39,10 @@ import 'css!./style';
let blurhashstr = target.getAttribute('data-blurhash');
if (blurhash.isBlurhashValid(blurhashstr) && target.getElementsByClassName('blurhash-canvas').length === 0) {
console.log('Blurhashing item ' + target.parentElement.parentElement.parentElement.getAttribute('data-index') + ' with intersection ratio ' + entry.intersectionRatio);
let width = target.offsetWidth;
let height = target.offsetHeight;
// let width = target.offsetWidth;
// let height = target.offsetHeight;
let width = 18;
let height = 18;
if (width && height) {
let pixels;
try {
@ -49,7 +51,6 @@ import 'css!./style';
console.log('Blurhash decode error: ' + err.toString());
return;
}
let canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;