Repository: lutris/lutris

Issue:
Zoom slider not working for itch.io source
### Bug description

Zoom slider not adjustable or visible for itch.io source


### How to Reproduce

1. navigate to itch.io source
2. open drop down menu

### Expected behavior

zoom slider working correctly for all other sources tested: steam, epic, gog

### Log output

```shell
N/A
cosmetic issue
```


### System Information

```shell
[System]
OS:              Debian GNU/Linux 11 bullseye
Arch:            x86_64
Kernel:          4.19.281-14744-g651a58cedce9
Desktop:         Not found
Display Server:  Not found

[CPU]
Vendor:          GenuineIntel
Model:           Intel(R) Core(TM) m3-6Y30 CPU @ 0.90GHz
Physical cores:  2
Logical cores:   4

[Memory]
RAM:             3.7 GB
Swap:            7.3 GB

[Graphics]
Vendor:          Intel
OpenGL Renderer: Mesa Intel(R) HD Graphics 515 (SKL GT2)
OpenGL Version:  4.6 (Compatibility Profile) Mesa 20.3.5
OpenGL Core:     4.6 (Core Profile) Mesa 20.3.5
OpenGL ES:       OpenGL ES 3.2 Mesa 20.3.5
Vulkan Version:  1.2.162
Vulkan Drivers:  Intel(R) HD Graphics 515 (SKL GT2) (1.2.145)
```


### Media (optional)

![Screenshot 2023-07-25 23 14 10](https://github.com/lutris/lutris/assets/83636481/8cc77745-5e6b-4eda-b02f-2230c1502281)


### Checklist:

- [X] I'm not asking for support with a game or the wine runner.
- [X] I have followed the above mentioned guides and have all the graphics and wine dependencies installed.
- [X] I have checked for existing issues that describe my problem prior to opening this one.
- [X] I understand that improperly formatted bug reports may be closed without explanation.


Discussion:
That's to be expected if Itch.io only provides 1 image format. 
But this format is a bit big, so we can add a smaller one at a different size, from the original larger images, like we do for Humble.
why not just scale the image? performance?

shall I close this as wontfix/intentional?
Maybe with Gtk4 we can do some on the fly scaling
We can do on the fly scaling with Cairo. We are doing that now, it's how we can now handle cover-art, and HiDPI media.

The get_scaled_surface_by_path() function does the scaling, but there's caching of the scaled surfaces in the cell-renderer.

I think @NarkyAbyss is asking for what cover art is already doing. Should be straightforward.
By on-the-fly, I was referring to something similar to Shotwell, where the user can finely adjust the size of the media and the UI stays smooth while doing so.

What we really need is differentiate between image format, and image size. Ideally, there should be 2 widgets: Buttons for selecting the image format (icon, banner, coverart) and a slider to adjust the size of the selected format.

It's confusing to have a slider for selecting between an arbitrary number of formats (and even more confusing when that number is 1)

With the changes you made and the icon view only drawing what is visible on screen, then we might have a chance to have that in Lutris before we move to Gtk4?
Ohhh, I see.

It would be tricky; you can scale to whatever size, but when you change the media size it blows the cache and rescales, and we're using high quality scaling- there's a perceptible delay.

You'd want to be scaling with a low quality method until the user lets go or something like that. Not sure how we'd work it. Not as trivial as I thought.

Resolving patch:
diff --git a/lutris/services/itchio.py b/lutris/services/itchio.py
--- a/lutris/services/itchio.py
+++ b/lutris/services/itchio.py
@@ -42,6 +42,16 @@ def get_media_url(self, details):
         return
 
 
+class ItchIoCoverMedium(ItchIoCover):
+    """itch.io game cover, at 60% size"""
+    size = (189, 150)
+
+
+class ItchIoCoverSmall(ItchIoCover):
+    """itch.io game cover, at 30% size"""
+    size = (95, 75)
+
+
 class ItchIoGame(ServiceGame):
     """itch.io Game"""
     service = "itchio"
@@ -82,6 +92,8 @@ class ItchIoService(OnlineService):
     drm_free = True
     has_extras = True
     medias = {
+        "banner_small": ItchIoCoverSmall,
+        "banner_med": ItchIoCoverMedium,
         "banner": ItchIoCover,
     }
     default_format = "banner"


Test patch: