include/chajian/imageChajian.php
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
/**
gd2库图片处理,添加水印
*/
class imageChajian extends Chajian
{
public $ext; //图片类型
public $img; //图片对象
public $mime; //图片对象
public $path; //图片地址
public $w = 0;
public $h = 0;
public $bool = false;
public $size = 0;
public $whbili = 0;//高和宽的比例
protected function initChajian()
{
$this->bool = function_exists('ImageCreate');
}
/**
创建图片对象$rotate旋转角度
*/
public function createimg($path,$rotate=0)
{
if(!$this->bool)return false;
$this->bool = false;
if(!file_exists($path))return false;
$this->ext = $this->getext($path);
$this->path = $path;
$img = $this->createimgobj($path);
$this->img = $img;
if(!$img)return false;
//判断是否旋转
if($rotate != 0 && $rotate<360 && $rotate>-360){
$white = $this->color('#ffffff',$img);
$img = imagerotate($img, $rotate, $white);//旋转
}
$this->w = imagesx($this->img);
$this->h = imagesy($this->img);
$this->size = ceil(filesize($this->path)/1024);
$this->whbili = $this->w/$this->h;
$this->bool = true;
}
/**
获取图片对象
*/
public function createimgobj($path)
{
$ext = $this->getmime($path);
后面还有 293 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
