png2sixel does not work for small png files (~140x165)
On arch linux with foot version: 1.18.1 +pgo +ime +graphemes -assertions
img2sixel 1.10.3
configured with:
libcurl: yes
libpng: no
libjpeg: no
gdk-pixbuf2: yes
GD: no
does not display small png files.
I have three test files with sizes 125x165 (a.png), 138x165 (b.png) and 138x140 (c.png). From these only b.png works. See screenshot below.
See https://github.com/saitoha/libsixel/issues/154.
@MiroPalmu I tried reproducing the issue using a small 8-bit sRGB PNG from the repository’s test data, but was unable to. Would you be able to provide the image that causes the problem?
Unfortunately I don't have those anymore.
Here is the same command on foot version: 1.22.3 +pgo +ime +graphemes -assertions:
I also tried all the images from the repo and it seems that only one works:
However, if I set font size to be large enough with ctrl-+ even that image stops working (I increased the font size between every img2sixel call):
@MiroPalmu When a terminal renders a sixel image, the final cursor position should end up on top of the last row of the image (not all terminals work the same way, but that's basically what's supposed to happen). So if the image you're viewing is less than the height of a single row, your shell's prompt can end up overwriting it completely, and it will appear as if nothing has been rendered.
If that's what happening here, you can try forcing a line break after the image to prevent the prompt overwriting it. So something like this:
img2sixel filename.png; echo