php imagick gif resize all frame

六月ゝ 毕业季﹏ 提交于 2020-01-03 04:40:34

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!