There is present naturalWidth
and naturalHeight
DOM attributes.
For example:
var image = new Image();
image.src = "test.jpg";
image.onload = function() {
alert('width - ' + image.naturalWidth);
alert('height - ' + image.naturalHeight);
}
Or see example on jsFiddle.
More info at MDN
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…