Page MenuHomePhabricator

Exclude redundant srcset attribute values (e.g. same url)
Closed, ResolvedPublic

Description

Sometimes MediaWiki decides not to create a thumbnail.

Either because the original is so small that no larger versions exist, or some other reason. In that case, one or both of the srcset values may be redundant. If a srcset 2x url is the same as srcset 1.5x url, it should be omitted. Similarly, if the srcset url is the same as the src url, it should be omitted entirely as well.

Note that this task applies regardless of T67383.

Example on Wikimedia Commons:

[[File:Lock_icon_blue.gif|12px]]

outputs:

<a href="/wiki/File:Lock_icon_blue.gif" class="image">
<img alt="Lock icon blue.gif"
 src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Lock_icon_blue.gif/12px-Lock_icon_blue.gif"
 width="12" height="10"
 srcset="https://upload.wikimedia.org/wikipedia/commons/0/00/Lock_icon_blue.gif 1.5x, https://upload.wikimedia.org/wikipedia/commons/0/00/Lock_icon_blue.gif 2x"
 data-file-width="16" data-file-height="13"></a>

Details

Related Gerrit Patches:
mediawiki/core : masterExclude duplicate srcset urls

Event Timeline

Krinkle created this task.May 17 2016, 7:43 PM
Restricted Application added a project: Commons. · View Herald TranscriptMay 17 2016, 7:43 PM
Restricted Application added subscribers: Zppix, Steinsplitter, Matanya, Aklapper. · View Herald Transcript

Change 299533 had a related patch set uploaded (by Matthias Mullie):
Exclude duplicate srcset urls

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

matmarex closed this task as Resolved.Jul 20 2016, 5:39 PM
matmarex removed a project: Patch-For-Review.

Change 299533 merged by jenkins-bot:
Exclude duplicate srcset urls

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