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

Question: How to define window size #214

Open
mmahmoudian opened this issue Apr 12, 2022 · 4 comments
Open

Question: How to define window size #214

mmahmoudian opened this issue Apr 12, 2022 · 4 comments

Comments

@mmahmoudian
Copy link

I'm sorry if this is duplicated or I have just missed it. I tried to find this in manpage and the Github issues but I came out empty.

I usually have images with various sizes on my computer, some are few pixels and some are thousands of pixels. The pqiv *.png would change the window size and when the image is very small, it basically very hard to locate the window on the screen, especially when --transparent-background is used. I wonder if there is a way to define absolute or minimum/maximum sizes for the window.

In my searches I found a comment that suggested --action "set_scale_mode_fit_px(INT, INT)" but this would affect the montage window, but does not enforce the on all images.

while testing I realized it actually does a pretty good job at keeping the window dimension stable while working with SVGs, but it does not work as good for png files.

@phillipberndt
Copy link
Owner

set_scale_mode_fit_px is supposed to provide this feature. I don't understand what exactly doesn't work. Could you elaborate?

@mmahmoudian
Copy link
Author

Thanks for the response and sorry for the delay in my response :)

To demo what I mean, I downloaded all the CC0 images from the first page of the following URL:

https://wordpress.org/openverse/search/image?q=software&license=cc0&extension=png

and ran pqiv --action "set_scale_mode_fit_px(100, 200)" ./Pictures/test_pqiv/*.png . The expected behavior is to have a 100x200 pixel window with persistent dimension, but what we get is a dynamically changing window dimension:

Peek.2022-04-21.13-38.mp4

@phillipberndt
Copy link
Owner

Ah. pqiv still maintains the aspect ratio of the image and resize the window accordingly to fit within the bounding box specified by the parameter.

What's your expected behavior in case the aspect ratio doesn't fit?

@mmahmoudian
Copy link
Author

I'm looking for/suggesting a feature to maintain the window size and shrink* the image to fit and fill the surrounding with transparent space (which is controlled by --background-pattern).

  • There are two ways in my mind to address this. either always "scale to fit", so that also smaller images get enlarged, or "scale large to fit" to only reduce the size of images that does not entirely fit into the window dimension, but does not enlarge the smaller images. I personally prefer the "scale large to fit".

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