export default function n(n,e,a){return void 0===e&&(e=500),void 0===a&&(a=1),new Promise((function(o,i){var r=new Image;r.src=n,r.onload=function(){var n=r.width,t=r.height,u=e/n,v=document.createElement("canvas"),c=v.getContext("2d");v.width=n*u,v.height=t*u,c&&c.drawImage(r,0,0,n*u,t*u);var d=v.toDataURL("image/jpeg",a);d?o(d):i(d)}}))}