Page MenuHomePhabricator

ArticleGuidance: SVG thumbnails are broken on Special:NewArticle
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

When a Wikidata item's image (P18) is an SVG file, the thumbnail on the search result card does not load. The thumbnail URL is missing the .png suffix that Commons needs for SVG thumbnails.

Steps to reproduce:

  1. Open Special:NewArticle.
  2. Search for "Lawrencium".
  3. Look at the thumbnail on the result card.

Expected: The card shows the lawrencium image.
Actual: The image does not load.

Technical notes

The code builds …/60px-Lawrencium.svg (HTTP 400) instead of …/60px-Lawrencium.svg.png (HTTP 200). The bug is in utils/commonsThumb.js and WikidataInfoFetcher::getCommonsImageUrl().

Acceptance criteria

  • SVG images show correctly as thumbnails on Special:NewArticle.

Related Objects

Mentioned Here
P18 my paste!

Event Timeline

SBisson triaged this task as Medium priority.
SBisson moved this task from Backlog to Pre-Visual Editor on the Article-Guidance board.

Change #1345575 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ArticleGuidance@master] Fix thumbnail URLs for SVG images from Wikidata

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

Change #1345575 merged by jenkins-bot:

[mediawiki/extensions/ArticleGuidance@master] Fix thumbnail URLs for SVG images from Wikidata

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

Nikerabbit changed the task status from Open to In Progress.Oct 5 2026, 7:24 AM
Nikerabbit added subscribers: GGalofre-WMF, Nikerabbit.

@SBisson @GGalofre-WMF The thumbnail is now shown, but this one is clipped vertically. Is this the expected behavior or separate issue?

As far as I can tell this is codex using background: center cover so that its whole thumbnail area is filled at the expense of part of the image being clipped. There is no perfect solution when the source image is not square and the text on this one makes it more obvious. I don't think there is anything to fix.