fix: 上传图片水印处理
This commit is contained in:
@@ -42,7 +42,7 @@ class Upload
|
||||
$filemd5 = $file->md5();
|
||||
$filesha1 = $file->sha1();
|
||||
|
||||
$image_model = SysImageUploadRecordModel::md5($filemd5)->find();
|
||||
$image_model = null; // SysImageUploadRecordModel::md5($filemd5)->find();
|
||||
if (is_null($image_model)) {
|
||||
$filename = Filesystem::disk('image')->putFile($param['module'], $file);
|
||||
// 处理图片
|
||||
@@ -62,7 +62,7 @@ class Upload
|
||||
// 读取水印图片
|
||||
$watermark_image = $image_manager->read(public_path() . $image_options['image']);
|
||||
// 缩放水印图片
|
||||
$watermark_image->scale((int)$image_options['width'], (int)$image_options['height']);
|
||||
$watermark_image->scale($image_options['width'], $image_options['height']);
|
||||
// 绘制水印图片
|
||||
$image->place(
|
||||
$watermark_image,
|
||||
@@ -170,8 +170,8 @@ class Upload
|
||||
],
|
||||
'image_options' => [
|
||||
'image' => data_get($watermark_config, 'watermark_image_value.value', ''),
|
||||
'width' => data_get($watermark_config, 'watermark_image_width.value', null),
|
||||
'height' => data_get($watermark_config, 'watermark_image_height.value', null),
|
||||
'width' => (int)data_get($watermark_config, 'watermark_image_width.value')?:null,
|
||||
'height' => (int)data_get($watermark_config, 'watermark_image_height.value')?:null,
|
||||
'position' => data_get($watermark_config, 'watermark_position.value', 'top-left'),
|
||||
'offset_x' => (int)data_get($watermark_config, 'watermark_offset_x.value', 0),
|
||||
'offset_y' => (int)data_get($watermark_config, 'watermark_offset_y.value', 0),
|
||||
|
||||
Reference in New Issue
Block a user