Getting the original size of a scaled image
<p>How can I get the original, unscaled, size of an image from javascript if my image is like this: <code>&lt;img src="picture.png" style="max-width:100px"&gt;</code>?</p>

<p>I found my answer, you can use <code>img.naturalWidth</code> to get the original width</p>

<pre><code>var img = document.getElementsByTagName("img")[0];
img.onload=function(){
    console.log("Width",img.naturalWidth);
    console.log("Height",img.naturalHeight);
}
</code></pre>

<p><a href="http://www.webdeveloper.com/forum/showpost.php?p=951590&amp;postcount=15" rel="nofollow">Source</a></p>
