I want to return the dimensions of a picture using Javascript and i want to ask you what is wrong with this code, because it does nothing.
Here' the code:
function getImgSize(url){
var img = new Image();
img.onload=function(){
return {
width: img.width,
height: img.height,
};
};
img.src = url;
}
Thanks in advance!