title: Adding Image to a PDF using jspdf makes the image black
body: <p>When i try to add the image in the URL to a PDF file the image comes completley black.<br>
     But when I click the download pdf button again the image gets added to the PDF.Only 
    when I do it the first time, the image comes as black. </p>
  
  <pre><code> function getBase64Image(url) {
  
  alert(url);
  var canvas = document.getElementById('myCanvas');
  var context = canvas.getContext('2d');
  var img = new Image();
  img.src = url;
  img.style.height ="181px";
  img.style.width ="183px";
  //img.crossOrigin ="Anonymous";
  
  context.drawImage(img,0,0);
  
  var dataURL = canvas.toDataURL("image/jpeg");
  alert(dataURL);
  document.body.appendChild(img);
  
  
  var doc = new jsPDF('landscape');
  
  doc.addImage(img,'JPEG',0,0,50,50);
  doc.save('Saved.pdf');
  
   }
  
  getBase64Image("http://localhost:64931/jspdf/download.png");
  </code></pre>