MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / loadImage

Function loadImage

ui/src/lib/export-image.ts:38–45  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

36}
37
38function loadImage(url: string): Promise<HTMLImageElement> {
39 return new Promise((resolve, reject) => {
40 const img = new Image();
41 img.onload = () => resolve(img);
42 img.onerror = () => reject(new Error('The image could not be rendered.'));
43 img.src = url;
44 });
45}
46
47/** Rasterise an already-scaled SVG string to a PNG blob. */
48export async function svgToPng(svg: string): Promise<Blob> {

Callers 1

svgToPngFunction · 0.85

Calls 1

resolveFunction · 0.70

Tested by

no test coverage detected