Search code examples
javascriptimagecanvashotlinking

Would drawing an image to a canvas be described as hotlinking if the image was from another site?


If you created an image object like so:

var imageObj = new Image();
imageObj.src = urlOfImageOnAnotherWebsite;

And then drew it to a canvas on my website like so:

var canvas = document.getElementById('cnv');
var context = canvas.getContext('2d');

imageObj.onload = function() {
    context.drawImage(imageObj, 0, 0);
    drawText(statusquote,date);
};

Would this be hotlinking the image? I initially am thinking no because I'm actually redrawing the image, and not hosting it.


Solution

  • Hotlinking is the act of using someone else's server and bandwidth to display content to your viewers. Since in this scenario the JavaScript still obtains the image from their site, it's hotlinking.