Page MenuHomePhabricator

Hovercard images do not respect hi-DPI/Retina display
Closed, ResolvedPublic


Hovercard images appear to always be loaded at 1x density; on a 'Retina'/hi-DPI display this leads to the preview images being a bit blurry. This is especially noticeable on diagrams/flags/maps/etc such in as the below screenshot, but is visible on photos as well.

Event Timeline

brion created this task.May 3 2015, 12:08 PM
brion raised the priority of this task from to Needs Triage.
brion updated the task description. (Show Details)
brion added a subscriber: brion.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 3 2015, 12:08 PM
brion set Security to None.

Change 208515 had a related patch set uploaded (by Brion VIBBER):
Hi-DPI/Retina support for hovercard images

Change 208820 had a related patch set uploaded (by Brion VIBBER):
Provide $.bracketedDevicePixelRatio convenience function

I'm concerned (maybe incorrectly) that this is being done on a case by case basis and anyone developing in MediaWiki shouldn't have to think about this. Can't we have a JavaScript and PHP API to do this? e.g. mw.util.getImage() / File()->getImage()

It seems to be any image generated on the server or client (maybe the latter via oojs or oojs ui) via a standard API (e.g. mw.util.getImageElement / file->getImage() should have data attributes and apply them for hdpi support..

brion added a comment.May 6 2015, 10:07 AM

Jon -- that's a good concern to have. I'll look into a cleaner high-level solution for JS stuff...

On PHP side, things using the standard wiki methods of image output should already give the 1/1.5/2x densities in srcset automatically, but I do seem to recall that doesn't cover all output cases. (At least early on, galleries and a couple other places didn't trigger the multiple resolutions.)

Change 208820 merged by jenkins-bot:
Provide $.bracketedDevicePixelRatio convenience function

Change 208515 merged by jenkins-bot:
Hi-DPI/Retina support for hovercard images

matmarex closed this task as Resolved.Sep 9 2015, 2:21 PM
matmarex assigned this task to brion.
matmarex removed a project: Patch-For-Review.