Here’s how you can get the image width and height of an image file at a remote URL.
1 2 3 4 5 6 7 8 9 10 11 12 13 | function getImgDims(url){ var img = new Image(); img.onload = function(){ var rtnArr=Array; rtnArr['width']=this.width; rtnArr['height']=this.height; return rtnArr; }; } |
This will return an a multi-element associative array containing values under “width” and “height” as its keys.