深圳市一览网络股份有限
公司
ShenZhen Elanw Network
Co.,Ltd.
地址:南山科技园南区数字技术园
B2 栋 4A
Add: Room A,4th Floor,Block
B2,Digi-Tech Park ,
电话(Tel):0755-86133725
传真(Fax):0755-22632616
网址
(Web):www.YL1001.com
/**
* GIF Encoder function.
* Combines the parsed GIF frames into one single animation.
*/
private
function
encode(
$new_filename
,
$newwidth
,
$newheight
){
$mystring
= "";
$this
->pointer = 0;
$this
->imagedata =
array
();
$this
->imageinfo =
array
();
$this
->handle = 0;
$this
->index=0;
$k
=0;
foreach
(
$this
->parsedfiles
as
$imagepart
){
$this
->loadfile(
$imagepart
);
$this
->get_gif_header();
$this
->get_application_data();
$this
->get_comment_data();
$this
->get_graphics_extension(0);
$this
->get_image_block(0);
//get transparent color index and color
if
(isset(
$this
->encdata[
$this
->index-1]))
$gxdata
=
$this
->encdata[
$this
->index-1]["graphicsextension"];
else
$gxdata
= null;
$ghdata
=
$this
->imageinfo["gifheader"];
$trcolor
= "";
$hastransparency
=(
$gxdata
[3]&&1==1);
if
(
$hastransparency
){
$trcx
= ord(
$gxdata
[6]);
$trcolor
=
substr
(
$ghdata
,13+
$trcx
*3,3);
}
//global color table to image data;
$this
->transfercolortable(
$this
->imageinfo["gifheader"],
$this
->imagedata[
$this
->index-1]
["imagedata"]);
$imageblock
= &
$this
->imagedata[
$this
->index-1]["imagedata"];
//if transparency exists transfer transparency index