-
Notifications
You must be signed in to change notification settings - Fork 103
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
as-image: Handle images which are smaller than the destination #255
base: main
Are you sure you want to change the base?
Conversation
+1 in general, but @hughsie has the last word. Regardless, Iains patch looks good to me and makes sense. |
This change seems overly complex - I think the solution is just to fix the scaling code to handle all requested sizes - see #256 |
Thanks Robert. The outcomes are different between the two cases though, I think. In this one we never upscale, but just position the source image in the middle, and in the other one (AFAICS) you upscale the required dimension so it fits. #256: |
We currently don't consider this case at all, which results in negative coordinates being passed to gdk_pixbuf_copy_area(). Let's instead look and see if the source image is smaller than the destination. If it is, we just need to put it in the middle of our desintation pixbuf.
5c230cb
to
0a9fc34
Compare
The image scaling here is deliberate as much as I remember. We had a long long discussion in the past how to handle icons that aren't the correct size for gnome-software UI. The options were a) scale icons so that it fits gnome-software UI, but makes icons blurry, or b) show pixel-perfect icons and throw off gnome-software UI elements due to that. It's mostly a tradeoff question. I don't think there's a right answer here. We used to have (b), but then we changed it to (a) so that we could rely on gnome-software UI looking as we designed it, and instead ask app authors to ship the correct size icons. Maybe the answer is different for front screenshots and option (b) would make more sense, but in that case I'd like to make sure that the up scaling doesn't apply to regular icons, because this here is generic code that applies to both I believe. |
Can't you just fix the appstream data in Ubuntu to ship font screenshots that are correctly sized for gnome-software? |
Isn't the value that GNOME software uses essentially arbitrary? Not sure it would be right for the appstream generator to have knowledge of the value I think icons use |
@kalev The AppStream spec is very explicit about icon sizes (there are rules that must be followed), but for screenshots there are only recommendations for apps and the software center has to deal with whatever it gets. |
We currently don't consider this case at all, which results in negative
coordinates being passed to gdk_pixbuf_copy_area().
Let's instead look and see if the source image is smaller than the
destination. If it is, we just need to put it in the middle of our
desintation pixbuf.
This fixes a bug in gnome-software on Debian/Ubuntu where font previews are not shown, because they are smaller than the
1024x96
(?) that gnome-software is requesting and the code tries to upscale them. A later error makes this fail, but we should probably handle this by just never upscaling.