Here is a simple way to get the dimensions of an image using javascript and HTML5 FileReader class.

if (window.File && window.FileReader && window.FileList && window.Blob) {

    var fr = new FileReader;

    fr.onload = function() { // file is loaded
        var img = new Image;

        img.onload = function() {
            console.log('Width: ', img.width); // image is loaded; sizes are available
            console.log('Height: ', img.height); 
        };

        img.src = fr.result; // is the data URL because called with readAsDataURL
    };

    fr.readAsDataURL(this.files[0]); // I'm using a <input type="file"> for demonstrating
} else {
   alert("Please upgrade your browser, because your current browser lacks some new features we need!");  
}