How can I get the real image dimension with javascript?
I tried
function getImageSizeReal(imgLink){
var img = new Image()
img.src = imgLink;
return [img.width, img.height];
}
However this only seems to be working sometimes in Opera . No luck in firefox or chrome (dunno about IE)
Anyways to do it?
I thought of maybe using an Ajax call, but then the imgLink cannot be a relative position, which would be difficult to parse due to some address like http://example.com/directory as i tried to get everything before the last /