dever 3 éve
szülő
commit
abff066c07
2 módosított fájl, 28 hozzáadás és 3 törlés
  1. 22 3
      database/upload.php
  2. 6 0
      lib/Store/Core.php

+ 22 - 3
database/upload.php

@@ -35,6 +35,14 @@ $vod_convert = array
 	2 => '云端转码',
 );
 
+$wh = array
+(
+	1 => '不限制',
+	2 => '高度小于宽度-横图',
+	3 => '高度大于宽度-竖图',
+);
+
+
 return array
 (
 	# 表名
@@ -72,11 +80,22 @@ return array
 			'search'	=> 'fulltext',
 			'list'		=> true,
 		),
+
+		'setwh'		=> array
+		(
+			'type' 		=> 'int-1',
+			'name' 		=> '宽高限制-仅限图片类资源',
+			'default' 	=> '1',
+			'desc' 		=> '宽高限制',
+			'match' 	=> 'is_numeric',
+			'option' 	=> $wh,
+			'update'	=> 'radio',
+		),
 		
 		'width'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '限制宽度-仅限图片类资源',
+			'name' 		=> '最小宽度-仅限图片类资源,设置后上传如果小于该数值,则不能上传成功',
 			'default' 	=> '0',
 			'desc' 		=> '请输入宽度',
 			'match' 	=> 'option',
@@ -87,7 +106,7 @@ return array
 		'height'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '限制高度-仅限图片类资源',
+			'name' 		=> '最小高度-仅限图片类资源,设置后上传如果小于该数值,则不能上传成功',
 			'default' 	=> '0',
 			'desc' 		=> '请输入高度',
 			'match' 	=> 'option',
@@ -143,7 +162,7 @@ return array
 		'save_type'		=> array
 		(
 			'type' 		=> 'int-1',
-			'name' 		=> '存储位置',
+			'name' 		=> '存储位置-如需进行后续操作,云端不支持,则需要本地处理、云端存储,建议选择云端存储为主,本地存储为辅',
 			'default' 	=> '1',
 			'desc' 		=> '存储位置',
 			'match' 	=> 'is_numeric',

+ 6 - 0
lib/Store/Core.php

@@ -176,6 +176,12 @@ class Core
 			if (($size < $this->data['file']['size']) && $size > 0) {
 				$this->output['status'] = -1;
 				$this->output['message'] = '文件不能超过'.(($size/1024)/1024).'MB';
+			} elseif ($this->limit && $this->config['setwh'] == 2 && $this->limit[0] < $this->limit[1]) {
+				$this->output['status'] = -1;
+				$this->output['message'] = '图片高度不能超过图片宽度';
+			} elseif ($this->limit && $this->config['setwh'] == 3 && $this->limit[0] > $this->limit[1]) {
+				$this->output['status'] = -1;
+				$this->output['message'] = '图片宽度不能超过图片高度';
 			} elseif ($this->limit && $this->config['width'] > 0 && $this->config['width'] < $this->limit[0]) {
 				$this->output['status'] = -1;
 				$this->output['message'] = '图片宽度不能超过' . $this->config['width'] . 'px';