How to get high-res thumbnails out of low-res SVGs in Mediawiki?

304
August 07, 2017, at 4:22 PM

I don't exactly know how to word this question properly, so I'll make an attempt:

See the rasterized SVG on this page? Looks pretty distorted, and - excuse me language - rather s***. Now let's compare it with the one here. Both of them have the exact same SVG file and the source code is identical in wikitext. The difference is in how the rasterized "thumbnail" is generated, it seems.

The result I get from MediaWiki.

The intended result.

From what I have noticed - correct me if I'm wrong - both Wikipedia and Wikia either create several rasterized thumbnails for the SVG, or just simply generate them on demand, depending on the size the pages want. MediaWiki by default however, only generates one thumbnail, which is implied to have the same resolution as the original SVG - which gives us blurry and **** raster-images when rasterizing a small SVG to a large image.

Either that, or the SVGs don't get scaled/resized prior to thumbnailing/rasterization, when they should be.

Just for heads up, here's some come from my LocalSettings.php:

$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg',
    'xls', 'mpp', 'pdf', 'ppt', 'tiff', 'ogg', 'svg',
    'woff', 'eot', 'woff2'
);
// $wgSVGConverters['ImageMagick'] = '"' . $wgImageMagickConvertCommand . '" -background white -thumbnail $widthx$height^! $input PNG:$output';
// $wgSVGConverters['ImageMagick'] = '$path/convert -density $width -geometry $width $input PNG:$output';
$wgSVGConverters['ImageMagick'] = '$path/convert -density 1200 -background none -geometry $width $input PNG:$output';
$wgSVGConverters['rsvg'] = '/usr/bin/rsvg-convert -w $width -h $height $input -o $output';
$wgSVGConverter = 'ImageMagick';
// $wgSVGConverter = 'rsvg';
$wgSVGMaxSize = 2048;
$wgMaxImageArea = 1.25e7;
$wgMaxAnimatedGifArea = 1.0e6; 
$wgUseImageResize = true;
$wgGenerateThumbnailOnParse = true;

So... how do I enable having multiple thumbnails, if the lack of them is the cause of the problem? Is this even the cause of the problem to begin with? If not, what is the real reason why I'm not getting my intended result? What can I do?

EDIT: Already solved by switching over to ImageMagick to RSVG.

Answer 1

Already solved by switching from ImageMagick to RSVG.

Rent Charter Buses Company
READ ALSO
Filter specific column in array in php

Filter specific column in array in php

I am trying to filter a specific column in an array in php using the code below:

264
Howto replace hyphen with shy inside paragraph with preg_replace

Howto replace hyphen with shy inside paragraph with preg_replace

How to search and replace hyphens within paragraphs to &shy?

205
application/json all requests going to 403

application/json all requests going to 403

Through postman, I am posting data to specific URL like sitecom/read_request

235
Bad performance in the cURL call on the same server

Bad performance in the cURL call on the same server

Why just few concurrency can cause block when cURL call on the same server

209