perf: 对webp文件的支持

This commit is contained in:
kuaifan
2023-04-06 10:34:23 +08:00
parent 433a46bba9
commit 8ffac1376a
16 changed files with 49 additions and 42 deletions

View File

@@ -61,7 +61,7 @@ class ProjectTaskContent extends AbstractModel
{
$path = 'uploads/task/content/' . date("Ym") . '/' . $task_id . '/';
//
preg_match_all("/<img\s+src=\"data:image\/(png|jpg|jpeg);base64,(.*?)\"/s", $content, $matchs);
preg_match_all("/<img\s+src=\"data:image\/(png|jpg|jpeg|webp);base64,(.*?)\"/s", $content, $matchs);
foreach ($matchs[2] as $key => $text) {
$tmpPath = $path . 'attached/';
Base::makeDir(public_path($tmpPath));