summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-02-10 21:13:11 +0100
committerhut <hut@lavabit.com>2013-02-10 21:13:11 +0100
commitf2cc491647fa0cb2cd37488d007d549a5c80ebc2 (patch)
treee13d855a867c45376765ab6f2c7983600356b674
parent2fc163162cb450e78a7b5f557da27eb8dc778141 (diff)
downloadranger-f2cc491647fa0cb2cd37488d007d549a5c80ebc2.tar.gz
ext.img_display: don't draw image when fonth/fontw is 0
-rw-r--r--ranger/ext/img_display.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py
index 191f5aa4..a89f6d8b 100644
--- a/ranger/ext/img_display.py
+++ b/ranger/ext/img_display.py
@@ -48,6 +48,8 @@ def draw(path, start_x, start_y, max_width, max_height):
     They are expressed in number of characters.
     """
     fontw, fonth = _get_font_dimensions()
+    if fontw == 0 or fonth == 0:
+      return
 
     max_width_pixels = max_width * fontw
     max_height_pixels = max_height * fonth