Page MenuHomePhabricator

Audio file embeds have messed up thumbnails in VisualEditor
Open, Needs TriagePublic

Description

Audio file embeds have messed up thumbnails in VisualEditor.

Example: https://en.wikipedia.org/wiki/South_Park?veaction=edit&section=10#Main_theme

(It was pretty difficult to find a real example, most audio embeds on Wikipedia are done using a variety of templates like Template:Listen and Template:Spoken Wikipedia. I can only hope y'all are not easily offended.)

There are a few issues:

  • Obviously, the thumbnail is stretched. There is no image to be generated for an audio-only file, so the imageinfo API responds with this file regardless of the requested thumbnail size: https://en.wikipedia.org/w/resources/assets/file-type-icons/fileicon-ogg.png
  • Attempting to resize the image (by dragging the corner) will instead immediately scale it to 0x0px
  • "Image size" controls are present in the media dialog, but not functioning

Event Timeline

matmarex created this task.Oct 2 2018, 8:23 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptOct 2 2018, 8:23 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 506923 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Improve rendering of audio files

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

Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptApr 28 2019, 8:57 PM

Change 506923 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Improve rendering of audio files

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

Issues with the patch:

  • The MediaWiki-generated fake thumbnail is not suppressed
  • The same treatment is needed for inline images

Issues with the patch:

  • The MediaWiki-generated fake thumbnail is not suppressed

Parsoid-generated. Currently we get the media type from the API, so we don't know immediately it's audio. As Parsoid now has <audio> tags would could suppress this src during toDataElement.

  • The same treatment is needed for inline images

Inline audio doesn't really work, it renders as block and so should probably be completely avoided.

Restricted Application added a project: VisualEditor. · View Herald TranscriptFeb 5 2020, 12:06 AM
matmarex moved this task from To Triage to Triaged on the VisualEditor board.Feb 12 2020, 5:24 PM

Change 572138 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Improve rendering of audio files (for real this time)

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

matmarex claimed this task.Feb 14 2020, 3:21 AM
matmarex added a subscriber: Esanders.

Change 572138 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Improve rendering of audio files (for real this time)

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