Page MenuHomePhabricator

MediaViewer blur effect should not happen when image is already loaded
Open, LowPublic

Description

MediaViewer applies a short blur transition to images when it displays them. The idea behind that is that loading images takes long, and to improve perceived performance we start with showing the thumbnail, resized to full screen, as a sot of transition effect; but that tends to have jarring artifacts, so we hide it behind a blur. This works decently, but there is no point to the blur when the image is already loaded. Whether an image is cached by the browser is not easy to establish (cache lookups are async and take a few milliseconds), but it would be trivial to check whether we already loaded the image in the same JS session (ie. the thumbnail provider promise is already fulfilled).

To reproduce, visit e.g. https://commons.wikimedia.org/wiki/Commons:Wiki_Loves_Monuments_2017_in_Italy/Finalists , open in MediaViewer and navigate back and forth between the first two images.

See also T71609: Test if replacing the blur effect with pixelation makes loading feel faster.