Suppose if my domain is A and I want to display an image from domain B I can do this successfully by placing the image URL from B in the src attribute of the img tag on my website and expect the picture to display. However when I try to display the image on a canvas and convert it to base64 using the toDataUrl function I am unable to do so due to CORS reasons.
My questions are - How come I get to display the image from domain B if it does allow cross origin resource sharing? Is it only a HTTP header setting on domain B that must be configured in order to allow my domain A to access the resource or is there a setting on domain A that needs to be activated as well?