zoukankan      html  css  js  c++  java
  • php缩略图

    /*引入文件Easyphpthumbnail.class.php
    引用地址:http://www.itdaodan.com/article-detail-id-252.html
    */
     
    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 ThinkEasyphpthumbnail ;
              $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 ;
        }
    }
  • 相关阅读:
    检查宿舍卫生
    代码优化中 主窗口 问题 解决
    授权 存储
    升级Xcode7&iOS9后,出现NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -980X)
    控制器里面添加控制器
    版本新特性
    ios图片适配问题
    启动图片调整
    luogu_1896【题解】状压DP
    luogu_2602【题解】数位DP 数字计数
  • 原文地址:https://www.cnblogs.com/M-D-Luffy/p/4010520.html
Copyright © 2011-2022 走看看