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

scale-factor-aware screenshot #114

Open
tintou opened this issue May 30, 2017 · 8 comments
Open

scale-factor-aware screenshot #114

tintou opened this issue May 30, 2017 · 8 comments

Comments

@tintou
Copy link
Contributor

tintou commented May 30, 2017

As it is the case with icons, we should take care of @2 screenshots in order to get better looking descriptions

@ximion
Copy link
Owner

ximion commented May 30, 2017

Just take a bigger screenshot size or scale up a smaller one?

@tintou
Copy link
Contributor Author

tintou commented May 30, 2017

The problem is that the screenshot is taken in the DPI of the client, here is an example:
loDPI
hiDPI

@tintou
Copy link
Contributor Author

tintou commented May 30, 2017

If you're on an HiDPI device, you'll see that the first screenshot is blurry when the second one is perfect

@ximion
Copy link
Owner

ximion commented May 30, 2017

@hughsie What do you think in terms of bloat vs. usefulness? Adding scaling will - if we do it in a compatible way which we obviously should - mess up any SC that encounters it and doesn't use a recent enough version of AppStream that supports this feature (we did this in the past though).

In terms of space, the screenshots will consume a bit more on AppStream data servers, which shouldn't be an issue. All in all, I don't see that many drawbacks to this, except that the number of projects that will supply scaled screenshots is likely really small (but that's okay, as long as Elementary uses this ^^).

A simple scale property like we do with icons would suffice here, likely, or maybe we should directly add a dpi property to the <image/> tag, so the SC can fetch the screenshot matching closest to the dpi of the screen...

Another thing wonder about is whether we should go all the way and also think about a formfactor property for screenshot images, which could be tablet, phone, screen, hi-dpi-screen etc, for apps that display differently depending on the screen resolution...
(Long-term plan ^^)

@hughsie
Copy link
Collaborator

hughsie commented May 31, 2017

I think @2 makes sense, as does scale=2 but I'm vetoing dpi as it's almost impossible to get the actual DPI of a screen.

@Kekun
Copy link

Kekun commented Aug 4, 2021

That would be great to have, especially as high DPI screens are less and less rare, and even more since we have appstream-powered phones which all use scale 2.

@ximion
Copy link
Owner

ximion commented Sep 11, 2021

Having an integer scale="2" property for images on screenshot elements makes a lot of sense to me...
Is fractional scaling a thing to be concerned about here, so would we ever have scale="1.83254"? Because I think that would be a nightmare to support properly.
If the same scaling support that we already have for icons is good enough for screenshots, then I'm happy with adding it. Then we would only need to hope that upstream projects actually add the right metadata ;-)

@cassidyjames
Copy link

cassidyjames commented Sep 23, 2021

@ximion generally the way that works on the web (and possibly even in GTK?) is that the next-highest integer image would be loaded and then scaled by the toolkit/browser/etc. So as long as you support integers in the spec, clients should be able to do what they need with non-integers.

(Since partial pixels don't exist, I don't think it's reasonable to try and support non-integer images anyway; it would generally look the same as the 2× image scaled down to 1.83254× 😉)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants