Page MenuHomePhabricator

SVG thumbnailing doesn't work with $wgResponsiveImages
Closed, ResolvedPublic

Description

Adding Brion since I think he has done a lot with this (feel free to correct me!)

From https://www.mediawiki.org/wiki/Thread:Project:Support_desk/$wgResponsiveImages_causing_issues_for_SVG_thumbnailing

Example of error: http://www.pidgi.net/wiki/File_talk:Mario_Kart_TV_logo_(alt)_-_Mario_Kart_8.svg

The code speaks for itself. srcset=" 1.5x, 2x" Nothing is being generated for
these, leaving the image as a broken link in browsers that support the property
and fit the criteria.

Version: unspecified
Severity: normal

Details

Reference
bz67081

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:39 AM
bzimport set Reference to bz67081.
bzimport added a subscriber: Unknown Object (MLST).

It works on Wikimedia wikis. Please provide reproduction instructions.

I looked at the linked page and that is not the HTML I see.

<a href="/wiki/File:Mario_Kart_TV_logo_(alt)_-_Mario_Kart_8.svg" class="image"><img alt="Mario Kart TV logo (alt) - Mario Kart 8.svg" src="/wiki/images/thumb/d/d3/Mario_Kart_TV_logo_%28alt%29_-_Mario_Kart_8.svg/1900px-Mario_Kart_TV_logo_%28alt%29_-_Mario_Kart_8.svg.png" width="1900" height="482" srcset="/wiki/images/thumb/d/d3/Mario_Kart_TV_logo_%28alt%29_-_Mario_Kart_8.svg/2850px-Mario_Kart_TV_logo_%28alt%29_-_Mario_Kart_8.svg.png 1.5x, 2x" /></a>

The 2x one is missing, the 1.5x one is there. Maybe your system is just unable to handle such large images?

Thanks for looking at this more thoroughly. I don't know much about the srcset params, so maybe I'm missing something here. Is there a reason the 2x wouldn't be provided? Doesn't that indicate a bug?

Might media wiki be configured by default with a max size for svg rendering?

What does the debug log say during rendering?

(In reply to Brion Vibber from comment #4)

Might media wiki be configured by default with a max size for svg rendering?

But, in that case, shouldn't 2x be eliminated?

What does the debug log say during rendering?

I'll try to ask for that.

Change 142172 had a related patch set uploaded by Brian Wolff:
Check for error before outputting srcset urls

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

That wiki couldn't make thumbs that big ( http://www.pidgi.net/wiki/api.php?action=query&prop=imageinfo&titles=File:Mario_Kart_TV_logo_%28alt%29_-_Mario_Kart_8.svg&iiurlwidth=3800&iiprop=url|mime ). The code didn't check $thumb->isError(), and ->getUrl() on a MediaTransformError object return false, which when cast to a string becomes the empty string.

immewnity wrote:

I'm the owner of the wiki that the error is being shown on. I forgot to mention that it only appears on larger thumbnail sizes, which makes sense with the function of srcset.

Here's all the SVG rendering-related settings in LocalSettings.php:

$wgAllowTitlesInSVG = true;
$wgSVGConverters = array( 'ImageMagick' => '/usr/bin/convert -density $widthx$height -background transparent -thumbnail $widthx$height\! $input PNG:$output');
$wgSVGConverter = 'ImageMagick' ;

The only thing in error log is the following:

mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed, referer: http://pidgi.net/wiki/index.php?title=File:Mario_Kart_TV_logo_(alt)_-_Mario_Kart_8.svg&action=submit

No idea if that could be related.

Brian, would this be related to a limited amount of memory, then? I don't recall having this issue in 1.19 (the previous version this wiki used prior to 1.23).

Change 142172 merged by jenkins-bot:
Check for error before outputting srcset urls

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

All patches mentioned in this report were merged or abandoned - is there more work left to do here (if yes: please reset the bug report status to NEW or ASSIGNED), or can you close this ticket as RESOLVED FIXED?

No reply to comment 10 - assuming this bug is FIXED.
If that is not the case: Please reopen and elaborate what is left to do here to get this report fixed.