diff options
-rw-r--r-- | ranger/core/actions.py | 3 | ||||
-rw-r--r-- | ranger/core/fm.py | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 3b30fe6b..eb091186 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -1025,7 +1025,8 @@ class Actions( # pylint: disable=too-many-instance-attributes,too-many-public-m return path cacheimg = os.path.join(ranger.args.cachedir, self.sha1_encode(path)) - if os.path.isfile(cacheimg) and \ + if self.settings.preview_images and \ + os.path.isfile(cacheimg) and \ os.path.getmtime(cacheimg) > os.path.getmtime(path): data['foundpreview'] = True data['imagepreview'] = True diff --git a/ranger/core/fm.py b/ranger/core/fm.py index e53d36e1..9f409a94 100644 --- a/ranger/core/fm.py +++ b/ranger/core/fm.py @@ -104,6 +104,11 @@ class FM(Actions, # pylint: disable=too-many-instance-attributes self.settings.signal_bind('setopt.preview_images_method', set_image_displayer, priority=settings.SIGNAL_PRIORITY_AFTER_SYNC) + self.settings.signal_bind( + 'setopt.preview_images', + lambda signal: setattr(signal.fm, 'previews', {}), + ) + if ranger.args.clean: self.tags = TagsDummy("") elif self.tags is None: |