Skip to content

Commit

Permalink
Upd: render.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ollm committed Aug 25, 2024
1 parent 7b1bbdf commit ea69ffe
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions scripts/reading/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,24 @@ async function render(index, _scale = false, magnifyingGlass = false)
_config.kernel = false;
}

let data = await image.resizeToBlob(src, _config);
img.src = data.blob;
img.classList.add('blobRendered', 'blobRender');
img.style.imageRendering = '';
try
{
let data = await image.resizeToBlob(src, _config);
img.src = data.blob;
img.classList.add('blobRendered', 'blobRender');
img.style.imageRendering = '';

renderedObjectsURL.push({data: data, img: img});
renderedObjectsURLCache[key] = data.blob;
renderedObjectsURL.push({data: data, img: img});
renderedObjectsURLCache[key] = data.blob;
}
catch(error)
{
console.error(error);

img.src = encodeSrcURI(app.shortWindowsPath(img.dataset.src, true));
img.classList.remove('blobRendered', 'blobRender');
img.style.imageRendering = '';
}
}
else
{
Expand Down

0 comments on commit ea69ffe

Please sign in to comment.