The way I do it is if the image is defined as an Image object in Javascript, you can just use the height & width properties.
Code:
var myImg=new Image();
myImg.src="images/myimage.jpg";
// this line waits for the image to finish loading so we
// can get the height & width properties
while (!myImg.complete) {}
var iWidth=myImg.width;
var iHeight=myImg.height;
This works for me on IE. I'm no expert so there may be simpler ways.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.