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

@@ -94,7 +94,7 @@ class ProjectTaskFile extends AbstractModel
if (!isset($this->appendattrs['width'])) {
$width = -1;
$height = -1;
if (in_array($this->ext, ['jpg', 'jpeg', 'gif', 'png'])) {
if (in_array($this->ext, ['jpg', 'jpeg', 'webp', 'gif', 'png'])) {
$path = public_path($this->getRawOriginal('path'));
[$width, $height] = Cache::remember("File::size-" . md5($path), now()->addDays(7), function () use ($path) {
$width = -1;