MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / svgToBase64

Function svgToBase64

scripts/magnify_image.js:1464–1474  ·  view source on GitHub ↗
(svg)

Source from the content-addressed store, hash-verified

1462 return url;
1463}
1464function svgToBase64(svg) {
1465 try {
1466 return (
1467 "data:image/svg+xml;charset=utf-8;base64," +
1468 btoa(new XMLSerializer().serializeToString(svg))
1469 );
1470 } catch (e) {
1471 console.log("ERROR: ", e);
1472 return null;
1473 }
1474}
1475function getResolutionCategory(width, height) {
1476 let min = Math.min(width, height);
1477 let max = Math.max(width, height);

Callers 1

getImgSrcsFromElementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected