深圳市一览网络股份有限
公司
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
/**
* Public part of the class
*
* @orgfile - Original file path
* @newfile - New filename with path
* @width - Desired image width
* @height - Desired image height
*/
function
resize(
$orgfile
,
$newfile
,
$width
,
$height
){
$this
->decode(
$orgfile
);
$this
->wr=
$width
/
$this
->originalwidth;
$this
->hr=
$height
/
$this
->originalheight;
$this
->resizeframes();
$this
->encode(
$newfile
,
$width
,
$height
);
$this
->clearframes();
}
/**
* GIF Decoder function.
* Parses the GIF animation into single frames.
*/
private
function
decode(
$filename
){
$this
->decoding = true;
$this
->clearvariables();
$this
->loadfile(
$filename
);
$this
->get_gif_header();
$this
->get_graphics_extension(0);
$this
->get_application_data();
$this
->get_application_data();
$this
->get_image_block(0);
$this
->get_graphics_extension(1);
$this
->get_comment_data();
$this
->get_application_data();
$this
->get_image_block(1);
while
(!
$this
->checkbyte(0x3b) && !
$this
->checkEOF()){
$this
->get_comment_data(1);
$this
->get_graphics_extension(2);
$this
->get_image_block(2);
}
$this
->writeframes(time());
$this
->closefile();
$this
->decoding = false;
}