imagesy 


gd apg

GET the height from an image.





PALETTE IMAGE

is the designation term for images with a small number of colors.

For this type of image, a maximum of 256 colors are accepted.


TRUECOLOR IMAGE

is the designation term for images with a great number of colors.

For this type of image, a maximum of 16,777,216 colors are accepted.





This function return FALSE on errors.



<?php

int imagesy 
GdImage $image )

where,

$image The image identifier to retrieve the height

?>

  $image   


The image identifier.



  1 EXERCISE   

<?php

$lang 
'en';

$tst_img "png/PNG 006 01.png";

echo 
$tst_img?><br><br>Existing Image
<br><br><img src="<?php echo $tst_img?>
alt="<?php echo $tst_img?>"><br><br>

<?php

$img01 
imagecreatefrompng($tst_img);

var_dump($img01);
echo 
'<br><br>';

$get_h imagesy($img01);

$en 'HEIGHT: ';

echo $
$lang $get_h ' px';

?>

 RESULT   

PNG 006 01.png

apr

HEIGHT: 245 px

  2 EXERCISE   

<?php

$lang 
'en';

$tst_img02 "gif/GIF 008 05.gif";

echo 
$tst_img02?><br><br>Existing Image
<br><br><img src="<?php echo $tst_img02?>
alt="<?php echo $tst_img02?>"><br><br>

<?php

$img02 
imagecreatefromgif($tst_img02);

var_dump($img02);
echo 
'<br><br>';

$get_h imagesy($img02);

$en 'HEIGHT: ';

echo $
$lang $get_h ' px';

?>

 RESULT   

GIF 008 05.gif

apr

HEIGHT: 60 px

The format of the displayed image may be different.