Problem
There are currently a few places where the gallery could be improved:
- it loads very big and heavy images for the fullscreen view
- it's missing the white background for transparent images
- has this issue: T259854
- does not take advantage of the full screen for image layout
Solution
This ticket is aims to optimize the gallery with respect to some these. Specifically:
- in-scope:
- use of iiurlwidth and iiurlheight props to make each fullscreen image as light as possible while still looking good (non-pixelated) on device
- include white background for transparent images
- resolves T259854
- use maximum screen size for image with the image info fixed on top with the same gallery background black color, as a temporary solution.
- out-of-scope:
- load order optimization, which could be addressed in T263009
- gallery landscape rendering, maybe a new ticket is in order for that. I believe we need the image info improvements to be figured out before we fix gallery landscape view
- "focus mode" and image info styling refinements, there are currently a couple of tickets related to that: T262371 and T262373
Notes & references
- Dev note: similar to the mobile web behaviour, you can request the image info with the prop iiurlwidth iiurlheight (example below). The server will crop the image and return the thumburl thumbheight thumbwidth, we can use that to improve the gallery
API request example: https://en.m.wikipedia.org/w/api.php?action=query&format=json&formatversion=2&prop=imageinfo&titles=File%3AIvory_tabernacle_Louvre_OA2587.jpg&iiprop=url%7Cextmetadata&iiurlwidth=220&iiurlheight=210