From a4fe57519e44aaf59b531fa08a48d5cd68b91fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=85=B1=E5=A4=A9=E5=B0=8F=E7=A6=BD=E5=85=BD?= Date: Mon, 21 Oct 2024 01:21:00 +0800 Subject: [PATCH] Adapt to the .webp images in advance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 提前适配webp格式图片 --- changelog/v8.0.4+263.md | 5 +++++ lib/src/utils/file_util.dart | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelog/v8.0.4+263.md diff --git a/changelog/v8.0.4+263.md b/changelog/v8.0.4+263.md new file mode 100644 index 00000000..b9bb69bf --- /dev/null +++ b/changelog/v8.0.4+263.md @@ -0,0 +1,5 @@ +- 提前适配webp格式图片 + +-------------------- + +- Adapt to the .webp images in advance \ No newline at end of file diff --git a/lib/src/utils/file_util.dart b/lib/src/utils/file_util.dart index 53fa0deb..afd672c9 100644 --- a/lib/src/utils/file_util.dart +++ b/lib/src/utils/file_util.dart @@ -8,7 +8,8 @@ class FileUtil { static final RegExp _archivePathPattern = RegExp(r'Archive - \d+ - .*'); static bool isImageExtension(String path) { - return path.endsWith('.jpg') || path.endsWith('.JPG') || path.endsWith('.png') || path.endsWith('.gif') || path.endsWith('.jpeg'); + String s = path.toLowerCase(); + return s.endsWith('.jpg') || s.endsWith('.png') || s.endsWith('.gif') || s.endsWith('.jpeg') || s.endsWith('.webp'); } static bool isJHenTaiGalleryDirectory(Directory directory) {