mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-29 14:01:07 +00:00
修复开启水印无法正常上传图片的问题
This commit is contained in:
parent
f1c80f0552
commit
521a35a0a0
@ -313,7 +313,7 @@ class Local extends BaseUpload
|
||||
$savePath = public_path() . $filePath;
|
||||
try {
|
||||
$Image = Image::open(app()->getRootPath() . 'public' . $filePath);
|
||||
$Image->water($watermark_image, $waterConfig['watermark_position'] ?: 1, $waterConfig['watermark_opacity'])->save($savePath);
|
||||
$Image->water($watermark_image, $waterConfig['watermark_position'] ?: 1, (int)$waterConfig['watermark_opacity'])->save($savePath);
|
||||
} catch (\Throwable $e) {
|
||||
throw new AdminException($e->getMessage());
|
||||
}
|
||||
@ -344,7 +344,7 @@ class Local extends BaseUpload
|
||||
if (strlen($waterConfig['watermark_text_color']) > 7) {
|
||||
$waterConfig['watermark_text_color'] = substr($waterConfig['watermark_text_color'], 0, 7);
|
||||
}
|
||||
$Image->text($waterConfig['watermark_text'], $waterConfig['watermark_text_font'], $waterConfig['watermark_text_size'], $waterConfig['watermark_text_color'], $waterConfig['watermark_position'], [$waterConfig['watermark_x'], $waterConfig['watermark_y'], $waterConfig['watermark_text_angle']])->save($savePath);
|
||||
$Image->text($waterConfig['watermark_text'], $waterConfig['watermark_text_font'], (float)$waterConfig['watermark_text_size'], $waterConfig['watermark_text_color'], $waterConfig['watermark_position'], [$waterConfig['watermark_x'], $waterConfig['watermark_y'], $waterConfig['watermark_text_angle']])->save($savePath);
|
||||
} catch (\Throwable $e) {
|
||||
throw new AdminException($e->getMessage() . $e->getLine());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user