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 ;
        }
    }
  • 相关阅读:
    为当前用户创建cron服务
    PHP程序员的简单运维
    mysql事件学习
    ubantu16.04服务器错误提示没有安装php_fileinfo扩展
    XAMPP配置vhosts多站点/绝对正确
    yii2框架获取刚插入数据库的id (原创)
    ajax详解
    Git密钥生成步骤SSH Key
    jquery禁用select和取消禁用
    a标签实现不跳转点击
  • 原文地址:https://www.cnblogs.com/M-D-Luffy/p/4010520.html
Copyright © 2011-2022 走看看