Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-26 15:07:12 +08:00
parent 81f72e2c4a
commit 12c13cd25a
22 changed files with 139 additions and 213 deletions

View File

@@ -232,14 +232,13 @@ class ImageUtil {
}
}
static final regExp =
static final _thumbRegex =
RegExp(r'(@(\d+[a-z]_?)*)(\..*)?$', caseSensitive: false);
static String thumbnailUrl(String? src, [int? quality]) {
if (src != null && quality != 100) {
bool hasMatch = false;
src = src.splitMapJoin(
regExp,
_thumbRegex,
onMatch: (Match match) {
hasMatch = true;
String suffix = match.group(3) ?? '.webp';