PHP GIF 动画缩略图
2016-03-09 16:06
471 查看
php 生成GIF图片
1 使用Imagick 生成GIF动画缩略图
参考网站:http://www.jb51.net/article/25859.htm
2 使用gd库生成,引入两个类文件
GIFDecoder.class.php
GIFEncoder.class.php
$decoder = new GIFDecoder ( "animated.gif" );
$frames = decoder->GIFGetFrames ( );
for ( $i = 0; $i < count ( $frames ); $i++ ) {
$fname = ( $i < 10 ) ? "frame0$i.gif" : "frame$i.gif";
fwrite ( fopen ( $fname, "wb" ), $frames [ $i ] );
}
1 使用Imagick 生成GIF动画缩略图
参考网站:http://www.jb51.net/article/25859.htm
2 使用gd库生成,引入两个类文件
GIFDecoder.class.php
GIFEncoder.class.php
$decoder = new GIFDecoder ( "animated.gif" );
$frames = decoder->GIFGetFrames ( );
for ( $i = 0; $i < count ( $frames ); $i++ ) {
$fname = ( $i < 10 ) ? "frame0$i.gif" : "frame$i.gif";
fwrite ( fopen ( $fname, "wb" ), $frames [ $i ] );
}
相关文章推荐
- PHP empty、isset、isnull的区别
- PHP获取某年第几周的开始日期和结束日期
- 利用xampp搭建Yii1.1.17
- php session过期时间设置,纯新手教学
- windows7上安装php7和apche2.4
- 彻底解决PHP Session不过期以及SessionId保持不变的问题
- php导入导出excel表格
- php手动释放内存
- phpmailer实现邮件发送
- PHP根据身份证号码验证、获取星座、生肖和性别函数
- 如何安装Yaf框架?
- php的学习笔记之面向对象(二)
- php 打印函数(echo , print, printf, print_f, var_dump)
- php 正则表达式
- php单例模式
- php工厂模式
- 我的vsftp.conf 及iptables 配置
- php标准库(SPL)-SPL函数
- 使用MultipleInputs和MultipleOutputs
- php 科学计数法转化正常数值输出 解决方案