In html this works:
<img id="invisImg" src="https://drive.google.com/uc?export=view&id=1oDTwDBuAM-IIuJi3iDE5BJlEDHolD68w">
But that picture doesn't show up if i then try to draw it on the canvas. If i download the picture and have a local link it works fine, but then i can't save the canvas to file due to a corrupted canvas error.
If I try:
$v2Img.attr("src","https://drive.google.com/uc?export=view&id=1oDTwDBuAM-IIuJi3iDE5BJlEDHolD68w");
In my script file the picture doesn't load at all.
I tried with pictures hosted on dropbox as well, same problem there.
Any suggestions?
Edit: here's the core of my code HTML:
<div id="canvas-container">
<h2>Grafik</h2>
<canvas id="canvas-1"></canvas>
<a id="saveCanvas" download="canvas.jpg">Spara canvas</a>
</div>
<img id="invisImg" src="v2.png">
<!-- Alternatives:
https://drive.google.com/uc?export=view&id=1oDTwDBuAM-IIuJi3iDE5BJlEDHolD68w
v2.png
-->
<script src="graphics.js"></script>
</body>
and graphics.js:
$(document).ready(function(){
var $canvas1 = $("#canvas-1");
var canvas1 = $canvas1[0];
var ctx = canvas1.getContext("2d");
ctx.drawImage(vpic,0,0,300,150);
var dt = canvas1.toDataURL("image/jpeg");
$("#saveCanvas").attr("href",dt);
});
var $vpic = $("#invisImg");
var vpic = $vpic[0];
The image doesnt show in the canvas if stored on another server, and if it is stored locally the canvas cant be saved. I also tried to upload it to my webhotel, to see if it only was a local problem, but that didnt matter you can see it here with some extra fluff.