diff options
author | toonn <toonn@toonn.io> | 2021-07-15 23:23:12 +0200 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2021-07-15 23:23:12 +0200 |
commit | 9fca586268c4fa04dd20d5b7b0fa69ccff19c187 (patch) | |
tree | e3f59a0e0c5de08997df99d4ebe30212808de333 | |
parent | 34b2f874bab040254ad0b64170ad987d1e6ee34e (diff) | |
download | ranger-9fca586268c4fa04dd20d5b7b0fa69ccff19c187.tar.gz |
img_display: Drop redundant close calls
-rw-r--r-- | ranger/ext/img_display.py | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py index afbe4e19..3e60da07 100644 --- a/ranger/ext/img_display.py +++ b/ranger/ext/img_display.py @@ -354,12 +354,10 @@ class ITerm2ImageDisplayer(ImageDisplayer, FileManagerAware): file_header = file_handle.read(24) image_type = imghdr.what(path) if len(file_header) != 24: - file_handle.close() return 0, 0 if image_type == 'png': check = struct.unpack('>i', file_header[4:8])[0] if check != 0x0d0a1a0a: - file_handle.close() return 0, 0 width, height = struct.unpack('>ii', file_header[16:24]) elif image_type == 'gif': @@ -382,7 +380,6 @@ class ITerm2ImageDisplayer(ImageDisplayer, FileManagerAware): except unreadable: height, width = 0, 0 else: - file_handle.close() return 0, 0 return width, height |