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
2 changed files with 3 additions and 0 deletions

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