PHP | Gmagick getimagedelay() Function
Last Updated :
21 Jan, 2020
The Gmagick::getimagedelay() function is an inbuilt function in PHP which is used to get the image delay. The delay is actually the time taken for the transition from one image to another in a gif animation.
Syntax:
int Gmagick::getimagedelay( void )
Parameters: This function doesn’t accepts any parameters.
Return Value: This function returns an integer value containing the image delay in centiseconds (100centi = 1sec).
Exceptions: This function throws GmagickException on error.
Below given programs illustrate the Gmagick::getimagedelay() function in PHP:
Program 1:
<?php
$gmagickAnimation = new Gmagick( 'g4gnanimation1.gif' );
$delay = $gmagickAnimation ->getimagedelay();
echo $delay ;
?>
|
Output:
100 // which means 1 second.
Program 2:
<?php
$gmagickAnimation = new Gmagick( 'g4gnanimation1.gif' );
$gmagickAnimation ->setimagedelay(200);
$delay = $gmagickAnimation ->getimagedelay();
echo $delay ;
?>
|
Output:
200
Reference: https://www.php.net/manual/en/gmagick.getimagedelay.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...