Conversion image links to base64 and adding them to zip file using JSZip
So basically I want to add few images to zip file and be able to download it. I have two variables holding sources of images - pic1, pic2 and a global variable basePic for holding base64 string. I have a function to convert image to base64 : var pic; //http://www.somesite.com/i/picture.jpg var pic2; //http://www.somesite.com/i/picture2.jpg var basePic;// base64 string of an image function getBase64FromImageUrl(url) { var img = new Image(); img.setAttribute('crossOrigin', 'anonymous'); img.onload = function () { var canvas = document.createElement("canvas"); canvas.width =this.width; canvas