ififfy / flipflip

Random slideshow of local images. Electron app for Mac/Windows/Linux
MIT License
155 stars 42 forks source link

Limit Zoom #291

Open r3a1d3a1 opened 2 years ago

r3a1d3a1 commented 2 years ago

Would be great to have the option of limiting zoom to screen size. That way, small photos are enlarged, and big ones don't overflow the screen. Thanks!

StarrHelixx commented 1 year ago

If you set the "Image Sizing" of a scene to "Fit Best" and then set the "Zoom End" to 1x, it will always end when the image is at it's full width/height.

r3a1d3a1 commented 1 year ago

But that wouldn't be zooming. I'm currently using "fit best" and zoom from 0.8 to 1.2. This works good for small pix, but not larger ones.

StarrHelixx commented 1 year ago

I'm a bit confused of how the size of the photo would matter with those settings. Could you possibly provide examples of pics that work well and ones that don't so I can better understand what you mean? Or a video example (feel free to message me on Reddit instead if it's sensitive)

r3a1d3a1 commented 1 year ago

The picture size that overflows screen depends on the screen resolution. I don't know your screen resolution. It's pretty simple to try. Use your desktop background for example. They're usually high-res.

Basically, if the image is larger than the screen-res, don't zoom in at all (unless it starts from <1 in which case, end it at 1), and if for example, it's only 0.8 of screen-res in any dimension, don't zoom more than 0.8^(-1)=1.25 even if zoom-end is set to a larger value.

StarrHelixx commented 1 year ago

I'm still a bit confused by your description, because it sounds like you are viewing image in their real resolution, but this isn't possible if you're actually using either "Fit Best" option. The only time images are shown in their real resolution is when using "Center" or "Center (No Clipping)". See: https://drive.google.com/file/d/1YBTkAvzkWraatTRklE69uwRPS5ocKE1B/view?usp=sharing

More over, if you are using "Fit Best" with 0.8x to 1.2x, every image will overflow the window size by that extra 0.2x, regardless of the image's resolution.

So, if I understand correctly, you're asking for a way to (1) show images in their real resolutions (i.e. Center), and (2) zoom them in such that they all have the same final dimensions (e.g. image with same resolution as the window will not scale at all & image with any dimension 1/2 resolution of window will scale 2x). Is that correct?

r3a1d3a1 commented 1 year ago

I'm terribly sorry. You're right in the first two paragraphs. I've two different scenes, one using "Fit best" and the other using "Center". I mistook one for another yesterday when I was verifying.

Response to your third paragraph: Not exactly. Here's the situation. I've a bunch of low-res photos mixed with the high-res ones. (Some are so low-res that fitting them to the screen would make them terribly pixelated, hence using the 'Center' option.) I like to have the 0.8-1.2 zoom on the ones that don't overflow the screen, but for the higher-res ones, I'd still like to have the zoom, but just as much as possible without overflowing the screen, AND limited to the prior 1.2x. So if the image height or width is equal or greater than screen-res, that would mean 0.8-1.0x. And if it's for example 0.9xScreen-height, then 0.8-1.11x. (1/0.9=1.11)

Thanks again!

r3a1d3a1 commented 1 year ago

It could be a toggle in Effects section, e.g. "Smart Zoom", because the amount of scaling in here, won't be image invariant anymore.