imcat icon indicating copy to clipboard operation
imcat copied to clipboard

Terminal-size detection overestimates terminal's height, have to scroll

Open MaxBarraclough opened this issue 4 years ago • 3 comments

If I use imcat to display an image, I find that it seems to overestimate the terminal's height, proceeding as if it has more (horizontal) lines than it really does, with the result that I can scroll up and down a few lines to view the image, but I can't see the whole image on screen at once.

An example image I used: https://wikilovesmonuments.org.uk/wp-content/uploads/2020/11/Perch_Rock_Lighthouse_in_rock_pool.jpg

I found that resizing my PuTTY window to be shorter, did not have any effect on the output of imcat. If I resized my PuTTY window to be both shorter and narrower, this had the desired effect of causing imcat to generate a smaller output (so that on restoring it to its full size, I could see the full image at once).

I'm using Ubuntu 20.10/AArch64. On the client side I'm using PuTTY 0.74. I'm not using tmux or GNU Screen or anything like that.

MaxBarraclough avatar Jan 15 '21 23:01 MaxBarraclough

Thank you for reporting, and trying out imcat.

The behaviour that you see is by design.

imcat will output the image to match the width of the terminal. Whether the image will fit the terminal height is entirely dependent on the aspect ratios of both the image and the terminal.

If the terminal aspect ratio does not exceed the image aspect ratio, the entire image will be visible.

stolk avatar Jan 15 '21 23:01 stolk

Thanks for the reply. To reframe this as a feature-request: would you be interested in adding the functionality so that the scale-to-fit honours both height and width? Perhaps this could be enabled with a command-line flag.

MaxBarraclough avatar Jan 16 '21 12:01 MaxBarraclough

Thanks for the reply. To reframe this as a feature-request: would you be interested in adding the functionality so that the scale-to-fit honours both height and width? Perhaps this could be enabled with a command-line flag.

I would also like this feature.

ivanelson avatar Feb 23 '22 18:02 ivanelson