You should destroy the $img too...
So it would be :
$img = @imagecreatefromjpeg("http://www.mysite.com/my_image.jpg");
if ($img) {
$img_height = imagesy($img);
ImageDestroy($img);
}
echo "My height is " . $img_height;
imagesy
(PHP 4, PHP 5)
imagesy — Obtener la altura de una imagen
Descripción
int imagesy
( resource $imagen
)
Devuelve la altura del recurso de imagen dado.
Lista de parámetros
- image
-
An image resource, returned by one of the image creation functions, such as imagecreatetruecolor().
Valores retornados
Devuelve la altura de la imagen o FALSE en caso de error.
Ejemplos
Example #1 Uso de imagesy()
<?php
// crear una imagen 300*200
$img = imagecreatetruecolor(300, 200);
echo imagesy($img); // 200
?>
imagesy
BSE_Icheb at hotmail dot com
21-Jun-2003 01:13
21-Jun-2003 01:13
boo at php dot net
14-Aug-2002 08:01
14-Aug-2002 08:01
To use this function notice that 'image' parameter it's a RESOURCE and NOT an Image File Path !
Here comes an exemple:
$img = @imagecreatefromgif("http://www.mysite.com/my_imag.gif");
if ($img) $img_height = imagesy($img);
echo "My height is " . $img_height;
