How to get in JavaScript width and height of image, before it's loaded?
<p>I'm wondering if it's possible to get sizes (width and height) of an image before it's loaded? Unfortunately I can't use something like this code:</p>

<pre><code>$('img').load(function() {
    alert(this.width + ' ' + this.height);
});
</code></pre>

<p>I can't wait while image is loading, <strong>I need to know sizes of an image at the beggining</strong>.</p>

<p>Is it possible or should I use for example PHP and getimagesize() function and pass it to HTML?</p>
