1 |
- const n=""+new URL("logoWatermark-270788fc.png",import.meta.url).href,g=async a=>{try{const t=document.createElement("img");t.setAttribute("crossOrigin","anonymous"),n&&typeof n=="string"&&n.includes("data:image"),t.src=n,await new Promise(i=>t.onload=i);const e=document.createElement("canvas");e.width=a.width,e.height=a.height;const o=e.getContext("2d");o.drawImage(a,0,0);const r=document.createElement("canvas");r.width=280,r.height=220,r.getContext("2d").drawImage(t,80,80);const c=o.createPattern(r,"repeat");return o.fillStyle=c,o.fillRect(0,0,e.width,e.height),e}catch(t){console.log(t)}},m=(a,t=1)=>a.toDataURL("image/png",t);export{g as a,m as c};
|