/*引入文件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 \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 ;
    }
}

最新文章

  1. U3D DrawCall优化手记
  2. [LeetCode] First Bad Version 第一个坏版本
  3. 使用Githua管理代码
  4. JQuery入门——进度条
  5. HDU1269 迷宫城堡
  6. Codeforces Gym 101138 D. Strange Queries
  7. ACM ICPC 2015 Moscow Subregional Russia, Moscow, Dolgoprudny, October, 18, 2015 G. Garden Gathering
  8. UVA 11865 Stream My Contest(最小树形图)
  9. JSON解析保存在类中
  10. "蓝筹"如何使程序猿?
  11. MooTools 异步请求验证
  12. Hide a file in a picture
  13. gulp脚本编写方法
  14. UVA - 12001 UVa Panel Discussion
  15. c#字符编码,System.Text.Encoding类,字符编码大全:如Unicode编码、GB18030、UTF-8,UTF-7,GB2312,ASCII,UTF32,Big5
  16. HeadFirst设计模式读书笔记之策略模式
  17. 初识正则表达式matcher.group
  18. Linux操作系统df相关问题解惑
  19. 嵌套RecyclerView左右滑动替代自定义view
  20. linux crontab定时器

热门文章

  1. SAP BDC 交货增强无法进入
  2. 【Hutool】Hutool工具类之日期时间工具——DateUtil
  3. linux内存碎片的概念
  4. 学号20155308 2006-2007-2 《Java程序设计》第3周学习总结
  5. 20145226夏艺华 《Java程序设计》实验报告五
  6. Python中的对象引用、浅拷贝与深拷贝
  7. GridSQL--Stado 学习初步
  8. poj 2079(旋转卡壳求解凸包内最大三角形面积)
  9. 【BZOJ2754】[SCOI2012]喵星球上的点名
  10. hadoop hdfs 找不到本地库解决办法