PHP 缩略图

来源:互联网 发布:剑网三优化版客户端 编辑:程序博客网 时间:2024/06/05 01:52
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 ;    }}

0 0
原创粉丝点击