Closed xeruf closed 7 months ago
Interesting, indeed. The reason is, that a PDF is treated as single 'image' as it is a single file even though it has multiple sub-images.
This should probably be broken up and behave as if it was separate independent images that then nicely arrange in the grid.
Alright, should be fixed now.
Can you do a fresh git pull
, recompile and test with your PDF ?
Thank you, works :)
Just a little thing, but that might also be the fault of kitty
-
When I allow height overflow, there is a slight offset within the grid:
timg --grid=2 Oceans\ \(D\)\ -\ Akkorde.pdf -W
Scrolled up:
I don't observe that with Kitty, but maybe the PDF has different page sizes ? I have to test for that situation and double check that -W
works in these cases.
(BTW, if you add --auto-crop
unnecessary whitespace around is cropped, so you might get less of the whitespace pixels using up space).
Re-opening now while investigation is going on to reproduce.
I am seeing this for any PDF with multiple pages, all A4, even with auto-crop
enabled (which is a good hint, thank you :) )
As said, this is only when the height overflows i.e. each image is bigger than the terminal height. It also happens for images, so this is not PDF-related.
So the problem here is, that if you have -W
, a page might be longer than the terminal and have to scroll down a little.
but in the grid, the cursor needs to jump up to the next page.
Now, the way terminals work, they don't allow to jump the cursor beyond the top of the terminal. So if the previos page is a bit longer, the next page will only be displayed starting from the position it could jump to .. slightly down.
So there is nothing we can do about this here.
In the latest release ( https://github.com/hzeller/timg/releases/tag/v1.6.0 ), the resolution of the rendering has been improved. I typically can easily read PDS with --grid=2x1 -U
or even --grid=3x1
(also, it is faster).
So if you read PDFs a lot, this might be an interesting release for you.
When previewing a pdf, the
--grid
parameter value is completely ignored.