MCPcopy
hub / github.com/ollm/OpenComic / loadImage

Function loadImage

scripts/image.js:300–308  ·  view source on GitHub ↗
(url, encode = false)

Source from the content-addressed store, hash-verified

298}
299
300function loadImage(url, encode = false)
301{
302 return new Promise(function(resolve) {
303 let image = new Image();
304 image.onload = function(){resolve(image)}
305 image.onerror = function(){resolve(image)}
306 image.src = encode ? encodeSrcURI(url) : url;
307 });
308}
309
310var sizesCache = {};
311

Callers

nothing calls this directly

Calls 2

resolveFunction · 0.85
encodeSrcURIFunction · 0.85

Tested by

no test coverage detected