Page MenuHomePhabricator

MediaViewer should not make an API request for each reuse size
Open, LowPublic

Description

Migrated from: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/473

Currently we fire an API request every time the user changes the selection on the embed or download size menu (and then have to deal with showing a sane UI while we are still waiting for the information).

We should just request all sizes when the panel is opened (or, as long as we use constant sizes for all files, we could even pack it into the original imageinfo request) and be done with it.

Acceptance criteria

  • add a new iiurlwikitextparameter to the imageinfo API; it should take a list of option strings (as expected by Parser::makeImage - in other word, a set of parameters from the wikicode of an image, in the form120px|lang=en|page=2) separated by ||
  • imageinfo should generate an URL for each option string
  • the URLs should be returned as children of the imageinfo node:

<ii url="..." descriptionurl=" . ..">

<iithumb url=" [[https://upload.wikimedia.org/wikipedia/commons/thumb/a/a9/Example.jpg/194px-Example.jpg | .]] .." width="..." height=".." />
...

</ii></pre>

Related bugs

https://bugzilla.wikimedia.org/show_bug.cgi?id=54035 API imageinfo should allow fetching multiple thumbnail sizes

Event Timeline

MingleTerminator raised the priority of this task from to High.Dec 8 2014, 5:28 PM
In mingle on 2014-04-21 at 17:42:03, @MarkTraceur wrote:

As far as I know we cannot do this with the current thumbnail request API. So...core patch! wooooo

In mingle on 2014-04-21 at 17:46:28, @MarkTraceur wrote:

Backlogging per IRC

In mingle on 2014-09-23 at 17:47:15, @Tgr wrote:

Blocked on bugzilla discussion.

In mingle on 2014-09-29 at 21:59:48, @Tgr wrote:

Added implementation details per discussion with anomie

In mingle on 2014-09-29 at 22:00:27, @Tgr wrote:

Bumped story points - this will require messing around with the parser.

Tgr lowered the priority of this task from High to Medium.Dec 11 2014, 12:45 AM

Lowering priority as we do not plan to work on this anytime soon.

Mass-removing the Multimedia tag from MediaViewer tasks, as this is now being worked on by the Reading department, not Editing's Multimedia team.

MarkTraceur lowered the priority of this task from Medium to Low.Apr 25 2017, 6:24 PM
MarkTraceur moved this task from Backlog to Triaged but Future on the MediaViewer board.
Krinkle renamed this task from Use single request to get all reuse sizes to MediaViewer should not make one API request for each reuse size.Thu, Jun 18, 1:12 AM
Krinkle renamed this task from MediaViewer should not make one API request for each reuse size to MediaViewer should not make an API request for each reuse size.

Change #1292874 had a related patch set uploaded (by Krinkle; author: Simon04):

[mediawiki/extensions/MultimediaViewer@master] Use imageinfo iiprop=thumburls and HTMLImageElement.srcset+sizes

https://gerrit.wikimedia.org/r/1292874