hzeller / timg

A terminal image and video viewer.
GNU General Public License v2.0
1.91k stars 73 forks source link

Displaying long images starting from the top instead of the bottom #99

Open sweetbbak opened 1 year ago

sweetbbak commented 1 year ago

Hey, I love your work with timg! I primarily use kitty and timg to view images and I was wondering if you possibly had a solution for really long images displaying starting from the bottom. Opening a long image in the terminal (around 1000px) will display the image starting at the bottom of the image and the content Im trying to view is meant to be read from top to bottom so I have to scroll to the top and then scroll back down and repeat this for each image.

Then I noticed that using timg's scroll flag, it will open the image at the top of the image and scroll from left to right. So I was wondering if there was a way to force the image to be loaded starting at the top or if maybe there was some kind of workaround that I could implement to achieve this?

The vertical delta scroll is amazing btw, this solves an issue with a project that I have been working on for some time now. I appreciate timg a ton.

Thank you!

hzeller commented 1 year ago

I don't think it is possible to load an image that is longer than the terminal and then jump back the scrollbar to the point where the image starts. At least I am not aware if terminals allow for that control via escape codes.

So the best bet is indeed using the scroll mode with delta that scrolls up --delta-move=0:1 --scroll (or, use negative number to scroll up).