Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MaxBarraclough opened this issue Jan 15, 2021 · 3 comments

Comments

@MaxBarraclough
Copy link

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 MaxBarraclough changed the title Screen-size detection overestimates terminal's height, have to scroll Terminal-size detection overestimates terminal's height, have to scroll Jan 15, 2021
@stolk
Copy link
Owner

stolk commented Jan 15, 2021

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.

@MaxBarraclough
Copy link
Author

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.

@ivanelson
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants