Browse Source

Render origin files in case of GIFs

vishnukvmd 2 years ago
parent
commit
3bfa5991d9
1 changed files with 6 additions and 1 deletions
  1. 6 1
      lib/ui/viewer/file/zoomable_image.dart

+ 6 - 1
lib/ui/viewer/file/zoomable_image.dart

@@ -161,7 +161,10 @@ class _ZoomableImageState extends State<ZoomableImage>
 
     if (!_loadingFinalImage && !_loadedFinalImage) {
       _loadingFinalImage = true;
-      getFile(_photo).then((file) {
+      getFile(
+        _photo,
+        isOrigin: isGIF(), // since playback only happens on origin files
+      ).then((file) {
         if (file != null && file.existsSync()) {
           _onFinalImageLoaded(Image.file(file).image);
         } else {
@@ -212,4 +215,6 @@ class _ZoomableImageState extends State<ZoomableImage>
       });
     }
   }
+
+  bool isGIF() => _photo.getDisplayName().toLowerCase().endsWith(".gif");
 }