SVG setting
editSolution
edit- Install ImageMagick
- Edit LocalSettings.php
$wgEnableUploads = true; $wgUseImageResize = true; $wgUseImageMagick = true; #$wgImageMagickConvertCommand = "/usr/bin/convert"; $wgImageMagickConvertCommand = "C:/Program Files/ImageMagick-6.3.2-Q16/convert";
References
editmw:Manual:Image_thumbnailing#SVG I read this article. But Error...:(
MediaWiki supports SVG image rendering: if enabled, SVG images can be used like other image files; they will automatically be rendered as a PNG file on demand. To enable SVG support:
First, Edit LocalSettings.php as following
$wgFileExtensions[] = 'svg'; $wgAllowTitlesInSVG = true;
If you get an error saying the file is corrupt, make sure mime type detection is working properly.
Second, set $wgSVGConverter
Available options are ImageMagick, sodipodi, inkscape, batik, rsvg.
The default is ImageMagick.
If the converter program is not in the system path, you have to specify the directory that contains the program using $wgSVGConverterPath.
My setting is following
$wgSVGConverter = 'ImageMagick'; $wgSVGConverterPath = "C:/Program Files/ImageMagick-6.3.2-Q16";
Windows XP
editDefault is following. this is for unix, linux
array( 'ImageMagick' => '$path/convert -background white -geometry $width $input $output', 'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output', 'inkscape' => '$path/inkscape -z -w $width -f $input -e $output', 'batik' => 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d $output $input', 'rsvg' => '$path/rsvg -w$width -h$height $input $output', );
But, in Windows XP, add " " as following
$wgSVGConverters = array( 'Inkscape' => '"$path/Inkscape/inkscape" -z -w $width -f $input -e $output', );
I set LocalSettings.php as following. I use Windows XP.
$wgSVGConverters = array( 'ImageMagick' => '"C:/Program Files/ImageMagick-6.3.2-Q16/convert" -background white -geometry $width $input $output', );
Note: C:\ (X), C:/ (O)
Success
editMost important is "insert position."
If you add command lines at any line, it will error.
Most important is "insert position."
I succeed!!
Add command lienes JUST AFTER $wgScriptPath = "/mediawiki"; as floowing
## The URL base path to the directory containing the wiki; ## defaults for all runtime URL paths are based off of this. $wgScriptPath = "/mediawiki"; $wgFileExtensions[] = 'svg'; $wgAllowTitlesInSVG = true; $wgSVGConverters = array( 'ImageMagick' => '"C:/Program Files/ImageMagick-6.3.2-Q16/convert" -background white -geometry $width $input $output', ); $wgSVGConverter = 'ImageMagick'; ## For more information on customizing the URLs please see: ## http://www.mediawiki.org/wiki/Manual:Short_URL $wgEnableEmail = true; $wgEnableUserEmail = true;
I think, following setting is for linux, unix
## The URL base path to the directory containing the wiki; ## defaults for all runtime URL paths are based off of this. $wgScriptPath = "/mediawiki"; $wgFileExtensions[] = 'svg'; $wgAllowTitlesInSVG = true; $wgSVGConverter = 'ImageMagick'; ## For more information on customizing the URLs please see: ## http://www.mediawiki.org/wiki/Manual:Short_URL $wgEnableEmail = true; $wgEnableUserEmail = true;