PHP | Gmagick getimageheight() Function
Last Updated :
23 Jan, 2020
The Gmagick::getimageheight() function is an inbuilt function in PHP which is used to get the image height which is the vertical length of the image.
Syntax:
int Gmagick::getimageheight( void )
Parameters: This function doesn’t accept any parameters.
Return Value: This function returns an integer value containing the height of image.
Exceptions: This function throws GmagickException on error.
Below given programs illustrate the Gmagick::getimageheight() function in PHP:
Used Image:
Program 1:
<?php
$gmagick = new Gmagick( 'geeksforgeeks.png' );
$height = $gmagick ->getimageheight();
echo $height ;
?>
|
Output:
184
Program 2:
<?php
$gmagick = new Gmagick( 'geeksforgeeks.png' );
$gmagick ->scaleimage(200, 200);
$height = $gmagick ->getimageheight();
echo $height ;
?>
|
Output:
200
Reference: https://www.php.net/manual/en/gmagick.getimageheight.php
Share your thoughts in the comments
Please Login to comment...