perf: 支持自定义上传图片压缩质量

This commit is contained in:
kuaifan
2024-12-02 10:40:55 +08:00
parent 4f57b195a8
commit 71f13a0b50
12 changed files with 42 additions and 38 deletions

View File

@@ -79,7 +79,7 @@ class ProjectTaskContent extends AbstractModel
$tmpPath = $path . 'attached/';
Base::makeDir(public_path($tmpPath));
$tmpPath .= md5($text) . "." . $matchs[1][$key];
if (Base::saveContentImage(public_path($tmpPath), base64_decode($text), 90)) {
if (Base::saveContentImage(public_path($tmpPath), base64_decode($text))) {
$paramet = getimagesize(public_path($tmpPath));
$content = str_replace($matchs[0][$key], '<img src="{{RemoteURL}}' . $tmpPath . '" original-width="' . $paramet[0] . '" original-height="' . $paramet[1] . '"', $content);
}