Skip to content

[icat] reading PNGs from STDIN silently fails #1920

@rien333

Description

@rien333

Not sure what component is at fault here, but icat seems to silently fail in outputing an image when reading any PNG image from STDIN:

cat foo.png | kitty icat

No difference with --stdin=yes. Appending --transfer-mode=stream outputs the image, but also outputs the following error:

cat foo.png |  kitty icat  --transfer-mode=stream
**[Image]**
...
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/bin/../lib/kitty/kittens/icat/main.py", line 387, in <module>
    main()
  File "/usr/bin/../lib/kitty/kittens/icat/main.py", line 370, in main
    process_single_item(item, args, url_pat)
  File "/usr/bin/../lib/kitty/kittens/icat/main.py", line 309, in process_single_item
    os.remove(item)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/stdin-image-data-t71wm64i'

Appending the transfer-mode flag does work as expected with JPG files (so no error, and a correctly displayed image), and so does regular jpg reading from stdin.

Possibly related to/duplicate of #1320 and #1340. Note that your curl example from #1340 does not work, at least not when using PNGs. It works fine when reading in jpg files.

Version Info

Arch Linux, with the following kitty version (compiled from HEAD):

kitty --version
kitty 0.14.3 created by Kovid Goyal

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions