mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-09-03 05:41:38 +08:00
数组定义用法统一
This commit is contained in:
@@ -50,12 +50,12 @@ class Gd{
|
||||
}
|
||||
|
||||
//设置图像信息
|
||||
$this->info = array(
|
||||
$this->info = [
|
||||
'width' => $info[0],
|
||||
'height' => $info[1],
|
||||
'type' => image_type_to_extension($info[2], false),
|
||||
'mime' => $info['mime'],
|
||||
);
|
||||
];
|
||||
|
||||
//销毁已存在的图像
|
||||
empty($this->im) || imagedestroy($this->im);
|
||||
@@ -146,7 +146,7 @@ class Gd{
|
||||
*/
|
||||
public function size(){
|
||||
if(empty($this->im)) throw new Exception('没有指定图像资源');
|
||||
return array($this->info['width'], $this->info['height']);
|
||||
return [$this->info['width'], $this->info['height']];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,12 +50,12 @@ class Imagick{
|
||||
$this->im = new \Imagick(realpath($imgname));
|
||||
|
||||
//设置图像信息
|
||||
$this->info = array(
|
||||
$this->info = [
|
||||
'width' => $this->im->getImageWidth(),
|
||||
'height' => $this->im->getImageHeight(),
|
||||
'type' => strtolower($this->im->getImageFormat()),
|
||||
'mime' => $this->im->getImageMimeType(),
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,7 +134,7 @@ class Imagick{
|
||||
*/
|
||||
public function size(){
|
||||
if(empty($this->im)) throw new Exception('没有指定图像资源');
|
||||
return array($this->info['width'], $this->info['height']);
|
||||
return [$this->info['width'], $this->info['height']];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -353,7 +353,7 @@ class Imagick{
|
||||
|
||||
//创建水印图像资源
|
||||
$water = new Imagick(realpath($source));
|
||||
$info = array($water->getImageWidth(), $water->getImageHeight());
|
||||
$info = [$water->getImageWidth(), $water->getImageHeight()];
|
||||
|
||||
/* 设定水印位置 */
|
||||
switch ($locate) {
|
||||
|
||||
Reference in New Issue
Block a user