posibles duplicados:
get image height and width in file tag javascript
Determining image file size + dimensions via Javascript?
How to upload preview image before upload through JavaScriptobtener la altura y la anchura de identificación de ficheros usando javascript
¿Cómo puedo obtener la altura y la anchura de la imagen sin recargar la página en la etiqueta de archivo?
<HTML>
<HEAD>
<TITLE></TITLE>
<script language="javascript">
function getW()
{
var theImg = document.getElementById('testimg');
alert(theImg.width);
}
function getH()
{
var theImg = document.getElementById('testimg');
alert(theImg.height);
}
</script>
</HEAD>
<BODY>
<input type="file" id="testimg"/>
<input type="button" value="get Width" onclick="getW()"/>
<input type="button" value="get Height" onclick="getH()"/>
</BODY>
</HTML>
Me da la altura de la imagen y el ancho de la imagen utilizando el código php, pero esa página tiempo se regenerará, sin recargar la página me sale tamaño de la imagen, pero no una altura y anchura ....
lolwut? 2 preguntas como esta una tras otra? http://stackoverflow.com/questions/6633190/get-image-height-and-width-in-file-tag-javascript – Pwnna
http://stackoverflow.com/questions/4094012/how-to-upload-preview- image-before-upload-through-javascript http://stackoverflow.com/questions/1310378/determining-image-file-size-dimensions-via-javascript – AmdY