Bug 355139 - Option/tool to automatically fit window to image (adapt window ratio)
Summary: Option/tool to automatically fit window to image (adapt window ratio)
Status: CONFIRMED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: Other (add details in bug description)
Platform: openSUSE Linux
: HI wishlist
Target Milestone: ---
Assignee: Amir Ehsandar
URL: http://pasteboard.co/22eRi0Wt.png
Keywords: junior-jobs, usability
Depends on:
Blocks:
 
Reported: 2015-11-10 16:02 UTC by Standa
Modified: 2021-10-16 10:24 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Standa 2015-11-10 16:02:34 UTC
Main windows size is kept constant, unless user resized. So when viewing images, window is either too big - space wasted, or too small - big images are scaled too small.

Reproducible: Always

Steps to Reproduce:
1. Set window to some size
2. View images with different size
3.

Actual Results:  
Screenshot of actual result:
http://pasteboard.co/22eRi0Wt.png

Expected Results:  
Make option to resize window to image size. So when viewing different images, window always changes it size to actual image.

Screenshot of expected result:
http://pasteboard.co/22eTEIXo.png
Comment 1 Nate Graham 2017-09-08 20:50:54 UTC
The only problem with this would be that as you used the arrow keys to move to new images, the window would be constantly resizing, which would drive a not-insignificant fraction of users insane.

Perhaps the ideal compromise is that the Gwenview window should open with optimal size for whatever image you launch Gwenview with, but then not resize for subsequent ones. This is what macOS Preview does.
Comment 2 Lapineige 2021-07-14 17:47:53 UTC
I do think that's a very good compromise.
Comment 3 Gabriel 2021-10-11 14:04:25 UTC
I quite like that Gwenview keeps a consistent size regardless of which image it displays. Imagine going through e.g. screenshots, starting at a small thumbnail sized one and skipping to the next that is taken of the whole screen. You'd need to resize the window because of the first picture's small size not being enough for the rest of the pictures. I also can't think of any other program that would launch at different sizes depending on the content it displays.

In the case of the macOS Preview, it's not so much a full program window, but rather more like a popup without a standard size. I think this behaviour would be better suited for Klook if that ever gets a revival. :^)
Comment 4 Lapineige 2021-10-12 06:40:59 UTC
@Gabriel : please note that I never asked for this to be the default and only behaviour.
Clearly it could be annoying for some workflow - and useful for others. I'm only needing an option :)

>  Imagine going through e.g. screenshots, starting at a small thumbnail sized one and skipping to the next that is taken of the whole screen

Well, that's what's bothering me with the current behaviour… it opens at the previous size used, which is most of the time not fit to the new images opened (so I will often have to resize it at first opening anyway), and then while opening following images the size is no longer relevant…

By the way:
> The only problem with this would be that as you used the arrow keys to move to new images, the window would be constantly resizing, which would drive a not-insignificant fraction of users insane.

I'm not sure, if it's not a default behaviour, that would be much of a problem. Users who try it (by changing the option) could just come back the the current behaviour.
Yet maybe it would be a problem with focus, as Gwenview could no longer be in focus ?
Comment 5 Gabriel 2021-10-12 14:25:07 UTC
(In reply to Lapineige from comment #4)
Fair enough, everyone has different expectations on the behaviour of their software. I support adding more options to account for that. :^)

It seems like the issue is really that it's tricky to resize the window quickly whenever needed, and that you might want to do that depending on the picture. Maybe it could work having a button in the toolbar that automatically sizes the window to fit to the current image? With a hotkey for that, you could quickly adapt to whatever you're viewing regardless of dimensions or orientation.
Comment 6 Lapineige 2021-10-12 15:40:14 UTC
> It seems like the issue is really that it's tricky to resize the window quickly whenever needed, and that you might want to do that depending on the picture.

That's the thing. Except that it mostly depends on the workflow/time of use than the pictures themselves, but that doesn't make a big difference in that case.
Having to resize the windows can be painful, and doing it in order to perfectly fit it to the image (with no margin left) is absolutely painful ^^

> Maybe it could work having a button in the toolbar that automatically sizes the window to fit to the current image? With a hotkey for that, you could quickly adapt to whatever you're viewing regardless of dimensions or orientation.

I would say that would solve 75% of the issue. And allow to mix both behaviour : keep it static for all images, or change it at any time.


Another thing that might be a concern : how would the window be resized ? I would say that if it's made in a way that make the header (the one with buttons to maximize/close/...), in my opinion that would be the more predictable and mainly the less inconvenient way to do it.
Comment 7 Gabriel 2021-10-12 17:04:52 UTC
(In reply to Lapineige from comment #6)
> Another thing that might be a concern : how would the window be resized ?
Ah right, good point. There wouldn't be much use in an automatic size adjustment if it makes the window way too large or small. Then you'd have to resize it afterwards, which defeats the point.

> I would say that if it's made in a way that make the header (...),
> in my opinion that would be the more predictable and mainly the
> less inconvenient way to do it.
Could you clarify please?

My immediate thought would be to make it adapt to the new dimensions, but with roughly the same window size as before. It would make it predictable since it wouldn't make the window cover your screen for big pictures or impossibly tiny with small ones, but instead stay pretty consistent. If you would want a smaller or larger window, you'd just change the size and click the adjust button to make it fit nicely. It's not a perfect solution, but I expect you'd always have to compromise somewhere.
Comment 8 Lapineige 2021-10-12 17:43:48 UTC
> My immediate thought would be to make it adapt to the new dimensions, but with roughly the same window size as before. It would make it predictable since it wouldn't make the window cover your screen for big pictures or impossibly tiny with small ones, but instead stay pretty consistent. 

Very good point, I didn't think about that.

> If you would want a smaller or larger window, you'd just change the size and click the adjust button to make it fit nicely. 

Sounds like a good way to do it.
To be honest I first thought about a window changing its size between images, but mainly between images that had mostly the same size, and some bigger ones (let's say from 1/4 of a screen to full screen), not tiny ones. In that last case, it would probably be annoying.

> > I would say that if it's made in a way that make the header (...),
> >in my opinion that would be the more predictable and mainly the
>> less inconvenient way to do it.
>Could you clarify please?

First of all, that was kind of independent from your following idea.

Second: If the window change its size, it could do it in different ways. Some of them would "move" all its 4 sides to another place, some would only change let's say the right and bottom side…
My point is that it should avoid moving the "header"/title bar (I don't know the name of that window element), the upper side I mean.

Yet the thing is, if as you have proposed its only the window aspect ratio that is changing (not the whole size + ratio), then it's already less problematic as the windows would usually¹ not change that much.

¹ apart from going from let's say portrait image to a large panoramic with a relatively low height
Comment 9 Gabriel 2021-10-12 18:18:08 UTC
(In reply to Lapineige from comment #8)
> My point is that it should avoid moving the "header"/title bar […].
Ah that makes a lot of sense! So that would keep the top left corner fixed in place? Sounds like a solid approach.

Then when it comes to comparing aspect ratios, I'm sure there are plenty good ways. Maybe keep the circumference constant or something. I also guess the image zoom would get set to "Fit" too.

I would love to have this in Gwenview. There is nothing nicer than when the picture lines up with all edges. I guess we should update the title for the bug?
Comment 10 Lapineige 2021-10-12 20:47:04 UTC
>  I also guess the image zoom would get set to "Fit" too.

I thought about it like this.
I didn't see an use case where you want the image to change (to the next/previous one) and the window to adapt to its new ratio while the zoom is not fit.

Now that you mention it, I would see one: to be able to open a panoramic image (or any extra wide/tall image) and to see it as large as possible…
But I believe it's kind of overkill to handle such an use case, which can just be solved by maximizing the window / putting it in full screen.

> I guess we should update the title for the bug?

I took the liberty to do it :) (feel free to change it if not appropriate)
Comment 11 Gabriel 2021-10-12 22:31:05 UTC
Yeah nah, I totally agree. I think this would cover most use cases just fine without adding unnecessary complexity.
Title looks good to me. Nicely done :^)

To summarize the feature request for whoever comes along to read this afterwards:
> - Button in the toolbar that adapts Gwenview's dimensions so that the
>     view area perfectly fits the displayed image.
> - Hotkey to quickly perform the action.
> - Adapts the aspect ratio while maintaining a similar size, e.g. by
>     keeping the view area's circumference constant.
> - When possible, letting the top left corner always stay fixed in place.
> - Sets zoom to 'Fit'.
Comment 12 Daniel Fichtner 2021-10-13 13:00:24 UTC
I'm just starting out here, but I'd love to have a look at implementing it :) So no promises but I'll give it a try :)
Comment 13 Gabriel 2021-10-13 14:33:26 UTC
(In reply to Daniel Fichtner from comment #12)
Oh, that's very nice to hear! No worries, there are no expectations here. It's nice to even just see the ambition. I wish you the best of luck with your developing endeavors!
Comment 14 Lapineige 2021-10-13 21:04:58 UTC
That's great news :)

If you need testers, feel free to ask :)

No promises, that would be great to have this feature, but it's a five years old feature, we can wait a bit longer ^^