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 — Resmin yüksekliğini döndürür
Açıklama
int imagesy
( resource
$resim
)Belirtilen resmin yüksekliğini döndürür.
Değiştirgeler
-
resim -
imagecreatetruecolor() gibi bir resim oluşturma işlevinden dönen bir resim verisi.
Dönen Değerler
Hata oluşmuşsa FALSE, aksi takdirde belirtilen resmin yüksekliğini
döndürür.
Örnekler
Örnek 1 - imagesy() örneği
<?php
// 300*200'lük bir resim oluşturalım
$img = imagecreatetruecolor(300, 200);
echo imagesy($img); // çıktısı: 200
?>
Ayrıca Bakınız
- imagecreatetruecolor() - Yeni bir gerçek renkli resim oluşturur
- getimagesize() - Bir resmin boyutlarını döndürür
- imagesx() - Resmin genişliğini döndürür
BSE_Icheb at hotmail dot com ¶
9 years ago
boo at php dot net ¶
10 years ago
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;
