Page MenuHomePhabricator

Make it possible for Wikifunctions calls to output directives to show images in Abstract Wikipedia articles
Closed, ResolvedPublicFeature

Description

Feature summary (what you would like to be able to do and where):
I want to add thumbnail images in Abstract Wikipedia articles.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
I've tried just adding HTML fragments with <img src=...>, but that didn't work. The HTML viewer gives an error "Usage of <img> tags is not allowed."

Benefits (why should this be implemented?):
This will vastly enrich Abstract Wikipedia content. Images can communicate a lot, even when language functions are not yet implemented.

Event Timeline

Adding support for media files is rather complicated, as:

  • we will want to restrict all uses to Wikimedia sites, i.e. upload.wikimedia.org;
  • to get the raw image, you need to MD5 the filename and then chop it up (e.g. File:Wikipedia-logo-v2-en.svg -> Wikipedia-logo-v2-en.svg -> b3c6a567391e03d0b4eb780aeae24eb5 -> b/b3/Wikipedia-logo-v2-en.svg;
  • for media uploaded to Commons, that's then reliably https://upload.wikimedia.org/wikipedia/commons/b/b3/Wikipedia-logo-v2-en.svg — given different wikis' copyright policies around fair use, that's probably all we'll support;
  • for non-largest thumbnails (which we can't know in isolation), that's controlled inside MW in a black box that turns requests into e.g. https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/Wikipedia-logo-v2-en.svg/120px-Wikipedia-logo-v2-en.svg.png;
  • for SVGs we proxy ~all user image requests to a down-rendered PNG instead;
  • for timed media (video files, audio files, etc.) we also would need to ship the player and extra information; and
  • we'd want to provide a convenient mechanism for Function authors to trigger all this without having to think too much about it.

It has been simplewiki’s policy for twenty years now, so I wouldn’t expect it to be an issue.

https://simple.wikipedia.org/wiki/Wikipedia:Image_use_policy

  • I have no issues with the restriction to Commons as our only source.
  • As a first pass it would even be okay if it excluded timed media, or even SVGs.
  • The rest sound reasonable.
Jdforrester-WMF renamed this task from show images in Abstract Wikipedia articles to Make it possible for Wikifunctions calls to output directives to show images in Abstract Wikipedia articles.Mar 25 2026, 5:13 PM
Jdforrester-WMF triaged this task as High priority.
Jdforrester-WMF added a project: Epic.