©
本文檔使用 php中文網手册 發布
(PECL imagick 0.9.0-0.9.9)
Imagick::writeImages — Writes an image or image sequence
$filename
, bool $adjoin
)Writes an image or image sequence.
filename
adjoin
成功时返回 TRUE
。
[#1] Malou [2010-01-16 13:25:11]
As mbrugue sugest, the second parameter can also be use to save an animated gif:
<?php
$anim = new Imagick();
$files = scandir($myFramesPath);
foreach( $files as $f )
{
$auxIMG = new Imagick();
$auxIMG->readImage($mytifspath.$f);
$anim->addImage($auxIMG);
}
//write animated gif
$anim->writeImages('anim.gif', true);
?>
[#2] mbrugue [2009-06-11 02:54:21]
The second parameter spicifies if the object is write in multipage file (true) or split every page in a single file (false).
Example:
<?php
$multiTIFF = new Imagick();
$files = scandir($mytifspath);
foreach( $files as $f )
{
$auxIMG = new Imagick();
$auxIMG->readImage($mytifspath.$f);
$multiTIFF->addImage($auxIMG);
}
//file multi.TIF
$multiTIFF->writeImages('multi.TIF', true);
//files multi-0.TIF, multi-1.TIF, ...
$multiTIFF->writeImages('multi.TIF', false);
?>