走过路过的都帮看看了, 用过Imagick的不点进来就亏了哈

yypf2540017 2014-09-11 08:38:00
现在Imagick生成gif就剩一个问题了。。。
生成的gif不能循环播放。。
$filelist = array(  
'frames/1.gif',
'frames/2.gif',
'frames/3.gif',
'frames/4.gif',
'frames/5.gif',
'frames/6.gif',
'frames/7.gif'

);
$animation = new Imagick(); //create animation object
$animation->setFormat('gif'); // set file type

foreach ( $filelist as $file ){

$image = new Imagick();
$image->readImage( $file );
$unitl = $image->getNumberImages();
$animation->addImage( $image );
$animation->setImageDelay(40); //$image->getImageDelay()
unset( $image );

}
header( "Content-Type: image/gif" );
echo( $animation->getImagesBlob() );
...全文
121 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
yypf2540017 2014-09-12
  • 打赏
  • 举报
回复
解决为 js循环gif了,居然每人回贴 只能无满意了

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧