Ver Mensaje Individual
  #8 (permalink)  
Antiguo 18/12/2006, 15:01
Cluster
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 22 años, 4 meses
Puntos: 129
Re: Obtener medidas de una imagen antes de aceptarla

Srs.

Esto no es correcto:

$info = getimagesize($_FILES['bandera']['filename']);

$anchura = imagesx($info);
$altura = imagesy($info);

lo que las funciones tipo imagesX o Y requieren es un "resource de imagen" generado por imagecreatefromXXX() funciones ..

La función getimagesize() de por sí ya entrega esa información (alto/ancho) en un array:

http://www.php.net/getimagesize

Cita:
User Contributed Notes
getimagesize
jlratwil at yahoo dot com
08-Nov-2006 10:10
Data types of the output array for getimagesize().

[0] = The width of the image. It is integer data type.
[1] = The height of the image. It is an integer data type.
[2] = Image Type Flag. It is an integer data type.
[3] = String for <img> tag (width="xxx" height="xxx"). It is a string data type.
[bits] = Number of bits. It is an integer data type.
[channels] = Number of channels. It is an integer data type.
[mime] = MIME type. It is a string data type.

Un saludo,
__________________
Por motivos personales ya no puedo estar con Uds. Fue grato haber compartido todos estos años. Igualmente los seguiré leyendo.