Topic on Project:Support desk

Terminator484 (talkcontribs)

Can somebody please help me get my wiki to display SVG files?  I'm having error after error, and I don't understand how SVG works yet.

  • Be advised: this is a private wiki that is offline (similar to a wiki-on-a-stick), running on Windows XP through the MoWeS Portable II server package.  The wiki version is MediaWiki 1.16.0.

I've successfully set my LocalSettings.php file to allow SVG uploads, and am using a few simple test images pulled straight from Wikipedia.

The Configuration settings and Image Administration Manuals here on MediaWiki have not been helpful at resolving the problem, and have only yielded more complicated errors that are not mentioned in those manuals.

My current LocalSettings.php configuration settings for SVG files reads as follows:

$wgAllowTitlesInSVG = true;
$wgSVGConverter = 'ImageMagick';
$wgSVGConverterPath = "C:\mowes\ImageMagick";
$wgSVGConverters = array( 'ImageMagick' => '$path/convert -background white -thumbnail $widthx$height\! $input PNG:$output');

The current error is:

Error creating thumbnail: convert: no delegates configuration file found (delegates.mgk).
convert: no delegate for this image format (SVG).
convert: Missing an image file name.
Terminator484 (talkcontribs)
Addendum
ALL image thumbnail rendering is also broken.  The error is vague and unhelpful:
Error creating thumbnail: The system cannot find the path specified.

Undoing the changes made to LocalSettings.php failed to correct the problem.

Please help.

Bawolff (talkcontribs)

The error

Error creating thumbnail: convert: no delegates configuration file found (delegates.mgk).
convert: no delegate for this image format (SVG).
convert: Missing an image file name.

I think means that you have image magick set up incorrectly (As in the convert program itself, not MediaWiki). Basically convert is missing a file that tells it how to thumbnail various image formats. Try re-installing image magick.

Error creating thumbnail: The system cannot find the path specified.

Did you set $wgImageMagickConvertCommand to something appropriate?

Terminator484 (talkcontribs)

How do I re-install ImageMagick on Windows?  Version 4.2.9 came as part of the MoWeS package; and I don't know how to upgrade anything on a server.

I didn't even have $wgImageMagickConvertCommand set to anything... but when I added that line, the error for thumbnails changed to:

Error creating thumbnail: convert: Unrecognized option (-set).

And the error for SVGs stayed the same.


Hiding the $wgSVGConverterPath = "C:\mowes\ImageMagick"; line changed the SVG error to:

Error creating thumbnail: Invalid Parameter - white
88.130.108.32 (talkcontribs)

> Error creating thumbnail: Invalid Parameter - white

After reading about passthru(), it seems there are some PATH issues. You can fix this bug by forcing the search path via $wgSVGConverterPath. For example, $wgSVGConverterPath = 'C:/Program Files/ImageMagick-6.4.5-Q16/' fixes it for me.

Terminator484 (talkcontribs)

I already tried that; see previous replies.

Terminator484 (talkcontribs)

Setting $wgSVGConverterPath = "C:\mowes\ImageMagick"; changes the error from "Error creating thumbnail: Invalid Parameter - white" to:

Error creating thumbnail: convert: no delegates configuration file found (delegates.mgk).
convert: no delegate for this image format (SVG).
convert: Missing an image file name.

It does not fix the problem.

Terminator484 (talkcontribs)

After a complicated (to put it mildly) upgrade to ImageMagick 6.8.0, the errors have all vanished...
...but there's one little bug remaining, that hopefully will be simpler to fix.

Among my test SVGs are a few generic images copied straight from the Wikimedia Commons.  Two of them are rendering oddly... File:X_mark.svg and File:Yes_check.svg are both just a black outline with white interiors: no colors.

Any idea what's wrong?

Bawolff (talkcontribs)

Wikimedia Commons uses a program named rsvg to render svgs. Sometimes rsvg and ImageMagick interpret images different (However, usually image magick is more correct).

Ciencia Al Poder (talkcontribs)

Those images use radial gradients, and a simple research on some forums suggests that ImageMagick doesn't support all of the SVG features, being radial gradients one of them. You may try to edit the file and convert that radial gradient to a fixed color, or install rsvg (which would require A LOT of dependencies to other packages).

Reply to "SVG rendering error"