|
|
@@ -313,7 +313,7 @@ class Stroage extends Model
|
|
|
* @param $file
|
|
|
* @return string
|
|
|
*/
|
|
|
- public static function filtterColor($file)
|
|
|
+ public static function filtterColor($file, $type=1, $light=6)
|
|
|
{
|
|
|
$filepath = dirname($file);
|
|
|
$newFile = $filepath . '/color_' . basename($file);
|
|
|
@@ -323,7 +323,9 @@ class Stroage extends Model
|
|
|
|
|
|
@fopen('upload/' . $newFile, 'w+');
|
|
|
$im = imagecreatefromjpeg('upload/' . $file);
|
|
|
- if ($im && imagefilter($im, IMG_FILTER_GRAYSCALE)) {
|
|
|
+ if ($im && imagefilter($im, 1)) {
|
|
|
+ imagefilter($im, 2, $light);
|
|
|
+// imagefilter($im, 4, 0,0,0);
|
|
|
imagepng($im, 'upload/' . $newFile);
|
|
|
} else {
|
|
|
$newFile = '';
|