问题
i have a problem to resize all frame using php imagick. it's take from official php doc example http://ir.php.net/manual/en/imagick.examples-1.php
/* Create a new imagick object and read in GIF */
$im = new Imagick("/tmp/bbb.gif");
/* Resize all frames */
foreach ($im as $frame) {
/* 50x50 frames */
$frame->thumbnailImage(50, 50);
/* Set the virtual canvas to correct size */
$frame->setImagePage(50, 50, 0, 0);
}
/* Notice writeImages instead of writeImage */
$im->writeImages("/tmp/zb.gif", true);
回答1:
Try the example on this page: http://www.php.net/manual/en/imagick.coalesceimages.php
Depending on how the gif was created you may need the Coalesce; also not the coment about version problems.
来源:https://stackoverflow.com/questions/11221927/php-imagick-gif-resize-all-frame