【发布时间】:2014-03-17 20:55:12
【问题描述】:
我有一些 JPEG 文件,我想用它们创建一个 GIF 动画。但是,此代码不起作用。你能看出是什么问题吗?
// animation
$animation = new Imagick();
$animation->setFormat("GIF");
// frames
foreach($tmpJpegPath as $jpepPath) {
$frame = new Imagick($jpepPath);
$frame->thumbnailImage(176, 144);
$animation->addImage($frame);
$animation->setImageDelay(100);
$animation->nextImage();
}
// save gif animation
$animation->writeImages('./animation.gif', true);
【问题讨论】:
-
确定它具有开箱即用的 jpeg 支持?它究竟是如何“不起作用”的?错误?
-
@ficuscr 如果您的意思是 $jpepPath 是我的 jpeg 文件的路径。没错。
-
问题已解决... imagick 必须 >= 3.1.0RC1
-
@sweb,请将其作为实际答案发布,然后将其标记为已接受。这将有助于未来可能遇到此问题的人。