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

[602 byte] By [gpata] at [2007-11-27 10:50:11]
# 1

> I need to find the width and height of an image in

> jsp.

JSPs have no images.

> my code is as follows:

That's not Java.

> How can i get the width and height of an image?

Probably by finding the element in the document and asking it. More info at your favorite Javascript board.

CeciNEstPasUnProgrammeura at 2007-7-29 11:23:47 > top of Java-index,Java Essentials,Java Programming...