PHP Imagick getImageInterations () function

PHP

Syntax:
int Imagick::getImageIterations (void)
Parameters:This function takes no parameters.Return value:This function returns an integer value containing the iterations of the image or frame.Exceptions:This function throws an ImagickException on error.The following programs illustrate the Imagick::getImageIterations()function in PHP:Program 1:  
// Create a new imagick object $imagick = new Imagick ( ' https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-13.png ' );  
// Get interactions $iterations = $imagick -> getImageIterations(); echo $iterations ; ?>
Output:
0 // Because it'sa still image.
Program 2:  
// Create a new imagick object $imagickAnimation = new Imagick ( ' https://media.engineerforengineer.org/wp-content/uploads/20191120143630/newanimated.gif ' );  
// Get interactions $iterations = $imagickAnimation -> getImageIterations(); echo $iterations ; ?>
Output:
4
Link: https:// www .php.net / manual / en / imagick.getimageiterations.php



Get Solution for free from DataCamp guru