perf: 优化图片压缩

This commit is contained in:
kuaifan
2024-10-23 15:37:00 +08:00
parent f9ceb3e2d8
commit 7445ac3a39
11 changed files with 92 additions and 53 deletions
+1 -1
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))) {
if (Base::saveContentImage(public_path($tmpPath), base64_decode($text), 90)) {
$paramet = getimagesize(public_path($tmpPath));
$content = str_replace($matchs[0][$key], '<img src="{{RemoteURL}}' . $tmpPath . '" original-width="' . $paramet[0] . '" original-height="' . $paramet[1] . '"', $content);
}