hi all,
i tried below code for retrieving image dimensions. It works in IE, however it doesnt work in firefox. Can any one help me to make this code work in Firefox too?
<html>
<head>
<script language=’JavaScript’>
function getImgSize(imgsrc)
{
var newImg = new Image();
newImg.src = imgsrc;
var height = newImg.height;
var width = newImg.width;
var filename = imgsrc.replace(/^.*
alert(“‘” + filename + “‘ is ” + width + ” by ” + height + ” pixels in size.”);
alert (‘The image size is ‘+width+’*’+height);
}
</script>
</head>
<body>
<form>
<INPUT TYPE=”file” NAME=”fileName” >
<p>
<INPUT TYPE=”button” VALUE=”check image dimensions” OnCLICK=”getImgSize(this.form.fileName.value)”>
</form>
</body>
</html>