How to get an uploaded image's height and width **before form submission**, using jQuery or Javascript?

```
<input type="file" />

```

I need to check whether the width and height of the image to be uploaded are equal to the selected width and height. I have found [this link](http://jsfiddle.net/4N6D9/1/). But it's only working for FF and Chrome, not in IE7 and IE8.

Can anyone show me any other way to get the dimensions so that it's working in all browsers?