作者:悲酥清风茶 | 来源:互联网 | 2018-07-16 21:52
ec(2);<?phptry{ ***Readintheanimatedgif*** $animationnewImagick("animation.gif"); ***Loopthroughtheframes
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();
}
?>