downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

imagetruecolortopalette> <imagesx
[edit] Last updated: Sat, 07 Jan 2012

view this page in

imagesy

(PHP 4, PHP 5)

imagesyGet image height

설명

int imagesy ( resource $image )

Returns the height of the given image resource.

인수

image

imagecreatetruecolor() 등의 이미지 생성 함수에서 반환한 이미지 자원.

반환값

Return the height of the image or FALSE on errors.

예제

Example #1 Using imagesy()

<?php

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

echo 
imagesy($img); // 200

?>

참고



add a note add a note User Contributed Notes imagesy - [2 notes]
up
0
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;
up
-1
BSE_Icheb at hotmail dot com
9 years ago
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;

 
show source | credits | stats | sitemap | contact | advertising | mirror sites