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) {