class Thumb{
protected $thumblocation = 'Attachment/thumbs/' ;
protected $size_icon = array ('72' => '72', '96' =>'96' , '144'=> '144' );
protected $size_logo = array ('480' => '800', '720' =>'1280' , '800'=> '1280' ,'1080' => '1920');
/**
* @todo 缩略图
* @param array $image
* @param array $size
* @return boolean
*/
public function thumbnail ($image ,$size){
if (empty ($image ) || empty ($size )){
return false ;
}
$image = (array)$image;
$size = (array)$size;
$thumb = new \Think\Easyphpthumbnail ;
$thumb -> Thumblocation = $this->thumblocation ;
foreach ($image as $k=>$v){
foreach ($size as $key=>$val){
$thumb -> Thumbprefix = $key.'_' ;
$thumb -> Thumbheight = $val;
$thumb -> Thumbwidth = $key;
$thumb -> Createthumb ($v,'file' );
}
}
return true ;
}
}
PHP 缩略图
最新推荐文章于 2021-03-09 21:13:12 发布