icat kitten: Fix display of 16-bit depth images

Fixes #2542
This commit is contained in:
Kovid Goyal 2020-04-13 23:05:10 +05:30
parent 5f5bb3ace0
commit 0196920533
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 0 deletions

View File

@ -39,6 +39,8 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Allow sending mouse events in kittens (:pull:`2538`)
- icat kitten: Fix display of 16-bit depth images (:iss:`2542`)
0.17.2 [2020-03-29]
--------------------

View File

@ -94,6 +94,7 @@ def convert(
if scaled or width > available_width or height > available_height:
width, height = fit_image(width, height, available_width, available_height)
cmd += ['-resize', '{}x{}!'.format(width, height)]
cmd += ['-depth', '8']
with NamedTemporaryFile(prefix='icat-', suffix='.' + m.mode, delete=False, dir=tdir) as outfile:
run_imagemagick(path, cmd + [outfile.name])
# ImageMagick sometimes generated rgba images smaller than the specified