diff options
author | mark-dawn <albama92@gmail.com> | 2018-09-30 18:37:16 +0200 |
---|---|---|
committer | mark-dawn <albama92@gmail.com> | 2018-09-30 18:37:16 +0200 |
commit | 7473c285fc3525aa70b684f3136b58e0352fe146 (patch) | |
tree | ad1d9a5f5f9262c5ea9d195b876c282498cdee19 | |
parent | 8e9451e6648c57d8016dad280132bf65a5d919cc (diff) | |
download | ranger-7473c285fc3525aa70b684f3136b58e0352fe146.tar.gz |
Fix for issue #1312 (wrong color format)
Moved the format conversion line from the stream section to the general one, as PIL does not autoconvert on save
-rw-r--r-- | ranger/ext/img_display.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py index f78e170b..cd9b18d6 100644 --- a/ranger/ext/img_display.py +++ b/ranger/ext/img_display.py @@ -588,14 +588,14 @@ class KittyImageDisplayer(ImageDisplayer): image = image.resize((int(scale * image.width), int(scale * image.height)), self.backend.LANCZOS) + if image.mode != 'RGB' and image.mode != 'RGBA': + image = image.convert('RGB') # start_x += ((box[0] - image.width) // 2) // self.pix_row # start_y += ((box[1] - image.height) // 2) // self.pix_col if self.stream: # encode the whole image as base64 # TODO: implement z compression # to possibly increase resolution in sent image - if image.mode != 'RGB' and image.mode != 'RGBA': - image = image.convert('RGB') # t: transmissium medium, 'd' for embedded # f: size of a pixel fragment (8bytes per color) # s, v: size of the image to recompose the flattened data |