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

Dynamically adjust rows and columns on window resize #15

Open
766F6964 opened this issue May 17, 2021 · 1 comment
Open

Dynamically adjust rows and columns on window resize #15

766F6964 opened this issue May 17, 2021 · 1 comment

Comments

@766F6964
Copy link

766F6964 commented May 17, 2021

Currently, one can change the amount of rows and columns with +_ and -_.
It would be nice if ucollage could dynamically adjust the amount of rows and columns when resizing the window, to allow for best use of the space in the terminal.

Examples:
May17_144136
May17_144146

@ckardaris
Copy link
Owner

ckardaris commented May 17, 2021

This is also a problem that is a little tricky because of how ueberzug draws images on the screen. Let me explain a little more how ucollage handles each image.

ueberzug takes the following parameters

  • x: the column we want to start drawing
  • y: the row we want to start drawing
  • width: how many columns are available
  • height: how many rows are available

When ucollage creates the grid, it sets this values for each image and then ueberzug does the rest, according to the scaler selected. In order to optimize the use of space we would need to know the resolution of the image (not that difficult to find through the use of secondary programs) and also how that resolution is mapped to the column width and row height of your terminal in order to select the optimal values.

For example how do we map a 3:2 resolution image to widthxheight so that the ratio (width * pixels_per_column)/(height * pixels_per_row) is 3:2.

I believe this is doable. I can search the web for it. But if you already have an idea and can help, I will be happy to listen to suggestions.

Then again, we have the problem. What resolution should we tailor our grid for our images to fit perfectly? But, this is manageable, through set options. It's interesting in any way and this issue can remain open for the time being.

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

2 participants