Closed amanjitsk closed 3 years ago
Works fine for me, that error indicates imagemagick on your system is producing unexpected output, what version of ImageMagick are you on?
Thanks for the super quick reply
Ah yes, its quite likely the new code needed to handle animated images will only work with ImageMagick version 7+. If you can update ImageMagick do so, otherwise I just made a commit that will show a more useful error message. Try it and post the error and I will see if I can workaround.
Ah thanks just tried it out. Here's the new error
Traceback (most recent call last):
File "/home/username/pkgs/kovidgoyal---kitty/kitty/launcher/../../kittens/tui/images.py", line 234, in render_image
f = ans.frames[index]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/username/pkgs/kovidgoyal---kitty/kitty/launcher/../../__main__.py", line 133, in <module>
main()
File "/home/username/pkgs/kovidgoyal---kitty/kitty/launcher/../../__main__.py", line 124, in main
namespaced(['+', first_arg[1:]] + sys.argv[2:])
File "/home/username/pkgs/kovidgoyal---kitty/kitty/launcher/../../__main__.py", line 81, in namespaced
func(args[1:])
File "/home/username/pkgs/kovidgoyal---kitty/kitty/launcher/../../__main__.py", line 71, in run_kitten
rk(kitten)
File "/home/username/pkgs/kovidgoyal---kitty/kitty/launcher/../../kittens/runner.py", line 106, in run_kitten
runpy.run_module('kittens.{}.main'.format(kitten), run_name=run_name)
File "/usr/lib/python3.8/runpy.py", line 210, in run_module
return _run_code(code, {}, init_globals, run_name, mod_spec)
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/username/pkgs/kovidgoyal---kitty/kitty/launcher/../../kittens/icat/main.py", line 579, in <module>
main()
File "/home/username/pkgs/kovidgoyal---kitty/kitty/launcher/../../kittens/icat/main.py", line 559, in main
process_single_item(item, cli_opts, parsed_opts, url_pat)
File "/home/username/pkgs/kovidgoyal---kitty/kitty/launcher/../../kittens/icat/main.py", line 487, in process_single_item
file_removed = process(item, args, parsed_opts, is_tempfile)
File "/home/username/pkgs/kovidgoyal---kitty/kitty/launcher/../../kittens/icat/main.py", line 337, in process
outfile, width, height = render_as_single_image(path, m, available_width, available_height, args.scale_up)
File "/home/username/pkgs/kovidgoyal---kitty/kitty/launcher/../../kittens/tui/images.py", line 270, in render_as_single_image
result = render_image(path, output, m, available_width, available_height, scale_up, only_first_frame=True)
File "/home/username/pkgs/kovidgoyal---kitty/kitty/launcher/../../kittens/tui/images.py", line 240, in render_image
raise ValueError(f'Unexpected output filename: {x!r} produced by ImageMagick command: {last_imagemagick_cmd}')
ValueError: Unexpected output filename: 'im-1888-7900.rgba' produced by ImageMagick command: ['/usr/bin/convert', '-background', 'none', '--', 'gruvbox.png', '-resize', '1888x790!', '-depth', '8', '-set', 'filename:f', '%w-%h-%g', '/tmp/tmpt4enl385/im-%[filename:f]-%d.rgba']
Yup, that's a bug in ImageMagick on your system.
convert -background none -- gruvbox.png -resize '1888x790!' -depth 8 -set 'filename:f' '%w-%h-%g' 'im-%[filename:f]-%d.rgba'
should produce a file named
im-1888-790-1888x790+0+0-0.rgba
instead it is producing a file named
im-1888-7900.rgba
it has ignored the %g part of the filename spec.
I suggest you stay with kitty 0.19.3 or update ImageMagick, ImageMagick 7 was released almost five years ago.
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
Download this image as
gruvbox.png
Run
kitty +kitten icat gruvbox.png
See this error
Expected behavior The image should be displayed
Environment details OS: Ubuntu 20.04 LTS