Here is how you can get the delay between the frames in gif file:
<?php
$animation = new Imagick("file.gif");
foreach ($animation as $frame) {
$delay = $animation->getImageDelay();
echo $delay;
}
?>
PHP - Manual: Imagick::getImageDelay
2024-11-14
(PECL imagick 2, PECL imagick 3)
Imagick::getImageDelay — Gets the image delay
Gets the image delay.
此函数没有参数。
Returns the image delay.
错误时抛出 ImagickException。
Here is how you can get the delay between the frames in gif file:
<?php
$animation = new Imagick("file.gif");
foreach ($animation as $frame) {
$delay = $animation->getImageDelay();
echo $delay;
}
?>
官方地址:https://www.php.net/manual/en/imagick.getimagedelay.php