Find Image height and width in jsp
Hello,
I need to find the width and height of an image in jsp.
my code is as follows:
.
<input type="File" size="40%" name="file" onchange="changeImage(this)">
var imgRe = /^.+\.(jpg|jpeg|gif|png)$/i;
function changeImage(fileField) {
var path = fileField.value;
if (path.search(imgRe) != -1) {
document.getElementById('newImg').src = 'file://' + path;
} else {
alert("JPG, PNG, and GIFs only!");
fileField.value = "";
}
}
How can i get the width and height of an image?
Thanks and regards

