I have an URL, for eg: w3schools image. When I try to read image and calculate its width and height, I'm getting null at img.src=imgData
.
This is the code I'm trying.Why I'm not able to read image from this URL.
var imgData = https://www.w3schools.com/w3css/img_fjords.jpg;
img.src = imgData;
img.onload = function () {
$rootScope.width = this.width;
$rootScope.height = this.height;
}