Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-12-29 21:02:05 +08:00
parent 2a52157c3f
commit b9d594bc8b
26 changed files with 280 additions and 230 deletions

View File

@@ -264,6 +264,17 @@ abstract final class ImageUtils {
}
}
static final _suffixRegex = RegExp(
r'\.(jpg|jpeg|png|webp|gif|avif)$',
caseSensitive: false,
);
static String safeThumbnailUrl(String? src) {
if (src != null && _suffixRegex.hasMatch(src)) {
return thumbnailUrl(src);
}
return src.http2https;
}
static final _thumbRegex = RegExp(
r'(@(\d+[a-z]_?)*)(\..*)?$',
caseSensitive: false,