php gif缩略图,php 给GIF 缩略图实例代码

忘是亡心i 2022-11-12 13:54 355阅读 0赞

try

{

/*** Read in the animated gif ***/

$animation = new Imagick(“animation.gif”);

/*** Loop through the frames ***/

foreach ($animation as $frame)

{

/*** Thumbnail each frame ***/

$frame->thumbnailImage(100, 100);

/*** Set virtual canvas size to 100x100 ***/

$frame->setImagePage(100, 100, 0, 0);

}

/*** Write image to disk. Notice writeImages instead of writeImage ***/

$animation->writeImages(“animation_thumbnail.gif”);

echo “Images written”;

}

catch(Exception $e)

{

echo $e->getMessage();

}

?>

发表评论

表情:
评论列表 (有 0 条评论,355人围观)

还没有评论,来说两句吧...

相关阅读

    相关 BootStrap略图

    通过缩略图组件扩展 Bootstrap 的 [栅格系统][Link 1],可以很容易地展示栅格样式的图像、视频、文本等内容。 默认样式的实例 Boostrap 缩略图的