diff options
-rw-r--r-- | ranger/core/actions.py | 4 | ||||
-rw-r--r-- | ranger/fsobject/file.py | 3 | ||||
-rw-r--r-- | ranger/gui/widgets/browsercolumn.py | 2 |
3 files changed, 3 insertions, 6 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 80db1aa5..5ffe315e 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -777,7 +777,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): return pager = self.ui.open_embedded_pager() - if self.settings.preview_images and self.thisfile.is_image(): + if self.settings.preview_images and self.thisfile.image: pager.set_image(self.thisfile.realpath) else: pager.set_source(self.thisfile.get_preview_source(pager.wid, pager.hei)) @@ -796,7 +796,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): pager = self.ui.browser.pager path = file.realpath - if self.settings.preview_images and file.is_image(): + if self.settings.preview_images and file.image: pager.set_image(path) return None diff --git a/ranger/fsobject/file.py b/ranger/fsobject/file.py index b79c6c7a..8598a1d6 100644 --- a/ranger/fsobject/file.py +++ b/ranger/fsobject/file.py @@ -61,9 +61,6 @@ class File(FileSystemObject): return True return False - def is_image(self): - return self.mimetype and self.mimetype.startswith('image/') - def has_preview(self): if not self.fm.settings.preview_files: return False diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index 02c2a5f0..a5579c15 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -168,7 +168,7 @@ class BrowserColumn(Pager): Pager.close(self) return - if self.fm.settings.preview_images and self.target.is_image(): + if self.fm.settings.preview_images and self.target.image: self.set_image(self.target.realpath) Pager.draw(self) else: |