perf: 优化缩略图

This commit is contained in:
kuaifan
2024-10-29 21:06:08 +08:00
parent 50a7950ccd
commit d799c06017
7 changed files with 257 additions and 33 deletions

View File

@@ -2507,7 +2507,7 @@ class Base
*/
public static function isThumb($file): bool
{
return preg_match('/_thumb\.(jpg|jpeg|png)$/', $file);
return preg_match('/_thumb\.(png|jpg|jpeg)$/', $file);
}
/**
@@ -2535,7 +2535,8 @@ class Base
*/
public static function thumbRestore($file): string
{
return preg_replace('/_thumb\.(jpg|jpeg|png)$/', '', $file);
$file = preg_replace('/_thumb\.(png|jpg|jpeg)$/', '', $file);
return preg_replace('/\/crop\/([^\/]+)$/', '', $file);
}
/**