private $file;
private $old_file;
private $is_thumb=false;
private $img;
public $width; //原图宽度
public $height;//原图高度
private $new_width; //新图宽度
private $new_height; //新图高度
public $type; //图片格式
public $mime; //扩展类型
private $frames = [];//GIF帧列表
private $delays = [];// 每帧等待时间列表
$file为需要水印的文件
public function __construct($file=null)
public function thumb($new_width=0,$new_height=0,$type=0)
$new_width 缩略图宽度
$new_height 缩略图高度
$type 为1时按最小比例缩放,2填充白色底图
public function save($is_copy=null)
$is_copy为ture时备份一个没有水印的图片,为false时不备份
public function water_text($text=null,$font=null,$size=null,$color=null,$locate=null,$offset = null,$angle=null,$line_feed=false,$line_width=0,$line_height=0,$is_save=true)
* 图像添加文字
* @param string $text 添加的文字
* @param string $font 字体路径绝对或者相对。必须能访问的到
* @param integer $size 字号
* @param string $color 文字颜色
* @param int|[x,y] $locate 文字写入位置
* @param integer $offset 文字相对当前位置的偏移量
* @param integer $angle 文字倾斜角度
* @param bool $line_feed 是否自动换行
* @param bool $line_width 如果换行,每行的宽度
* @param bool $line_height 如果换行,每行的字体高度
* @param bool $is_save 是否直接保存
public function water_images($source=null, $locate = null, $alpha = null ,$is_save=true)
添加图片水印
@param string $source 水印图片路径.绝对路径
* @param int $locate 水印位置
* @param int $alpha 透明度
* @param bool $is_save 是否直接保存
*/