imagesy

(PHP 3, PHP 4, PHP 5)

imagesy -- 取得图像高度

说明

int imagesy ( resource image )

imagesy() 返回 image 所代表的图像的高度。

例子 1. 使用 imagesy()

<?php

// create a 300*200 image
$img = imagecreatetruecolor(300, 200);

echo
imagesy($img); // 200

?>

参见 imagecreatetruecolor()getimagesize()imagesx()


add a note add a note User Contributed Notes
BSE_Icheb at hotmail dot com
21-Jun-2003 07:13
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;
boo at php dot net
14-Aug-2002 02: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;