SVG: $wgSVGConverters | ||
List of paths to Scalable Vector Graphics (SVG) converters. | ||
Introduced in version: | 1.4.0 | |
Removed in version: | still in use | |
Allowed values: | (array) see below | |
Default value: | see below | |
Other settings: Alphabetical | By function |
Details
Scalable Vector Graphics (SVG)는 이미지로 업로드될 수 있습니다. 어쨌든, 브라우저에서 SVG 지원은 불완전합니다 – 특히, 버전 9 이전의 Internet Explorer는 SVG 형식을 전혀 이해할 수 없었습니다.
따라서, SVG 형식의 이미지를 대체 수단으로 PNG 형식으로 변환해야 합니다. 외부 프로그램이 이 변환을 수행하기 위해 필요합니다.
이 배열은 SVG 변환 프로그램 목록과 각 프로그램에 대한 명령줄을 포함하고 있습니다. 시스템에서 사용할 것을 선택하려면, $wgSVGConverter 변수를 설정하십시오.
Default values
MediaWiki version: |
≥ 1.25
|
$wgSVGConverters = [
'ImageMagick' =>
'$path/convert -background "#ffffff00" -thumbnail $widthx$height\! $input PNG:$output',
'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output',
'inkscape' => '$path/inkscape -w $width -o $output $input',
'batik' => 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d '
. '$output $input',
'rsvg' => '$path/rsvg-convert -w $width -h $height -o $output $input',
'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
'ImagickExt' => [ 'SvgHandler::rasterizeImagickExt' ],
];
MediaWiki versions: |
1.23 – 1.24
|
$wgSVGConverters = array(
'ImageMagick' => '$path/convert -background white -thumbnail $widthx$height\! $input PNG:$output',
'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output',
'inkscape' => '$path/inkscape -w $width -o $output $input',
'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',
'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
'ImagickExt' => array( 'SvgHandler::rasterizeImagickExt' ),
);
MediaWiki versions: |
1.21 – 1.22
|
$wgSVGConverters = array(
'ImageMagick' => '$path/convert -background white -thumbnail $widthx$height\! $input PNG:$output',
'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output',
'inkscape' => '$path/inkscape -w $width -o $output $input',
'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',
'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
'ImagickExt' => array( 'SvgHandler::rasterizeImagickExt' ),
);
MediaWiki versions: |
1.18 – 1.20
|
$wgSVGConverters = array(
'ImageMagick' => '$path/convert -background white -thumbnail $widthx$height\! $input PNG:$output',
'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output',
'inkscape' => '$path/inkscape -w $width -o $output $input',
'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',
'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
'ImagickExt' => array( 'SvgHandler::rasterizeImagickExt' ),
);
MediaWiki versions: |
1.14 – 1.17
|
$wgSVGConverters = array(
'ImageMagick' => '$path/convert -background white -thumbnail $widthx$height\! $input PNG:$output',
'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output',
'inkscape' => '$path/inkscape -w $width -o $output $input',
'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',
'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
);
MediaWiki version: |
1.13
|
$wgSVGConverters = array(
'ImageMagick' => '$path/convert -background white -geometry $width $input PNG:$output',
'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output',
'inkscape' => '$path/inkscape -w $width -o $output $input',
'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',
'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
);
MediaWiki versions: |
1.10 – 1.12
|
$wgSVGConverters = array(
'ImageMagick' => '$path/convert -background white -geometry $width $input PNG:$output',
'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output',
'inkscape' => '$path/inkscape -w $width -o $output $input',
'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',
);
MediaWiki versions: |
1.5 – 1.9
|
$wgSVGConverters = array(
'ImageMagick' => '$path/convert -background white -geometry $width $input $output',
'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output',
'inkscape' => '$path/inkscape -w $width -o $output $input',
'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',
);
MediaWiki version: |
1.4
|
$wgSVGConverters = array(
'ImageMagick' => '$path/convert -background white -geometry $width $input $output',
'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output',
'inkscape' => '$path/inkscape -w $width -o $output $input',
'batik' => 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d $output $input',
);
Usage
다음 변수는 명령줄에서 지정될 수 있습니다:
- $path - 설정되었으면, $wgSVGConverterPath의 값; 그렇지 않으면 $path/ (슬래시를 주목)가 제거될 것입니다.
- $input - 입력 SVG 파일에 대한 경로
- $output - 미디어위키가 출력 PNG 파일을 찾으려는 경로
- $width - 원하는 너비
- $height - 원하는 높이
Example
mysvg2png라는 실행 파일이 시스템 경로에 있다고 가정하는 가상의 예제:
$wgSVGConverters = [
'mysvg2png' => '$path/mysvg2png -input $input -toFormat PNG -w $width -h $height -output $output'
];
$wgSVGConverter = 'mysvg2png';
Platform-specific notes
Windows
실행 경로가 스페이스를 포함할 수 있는 윈도우에서, 실행 파일 이름을 인용해야 할 수 있습니다. 예를 들어:
$wgSVGConverters = [
'inkscape' => '"$path/Inkscape/inkscape" -z -w $width -f $input -e $output',
];
윈도우-제품군 운영 시스템에서, 느낌표 (!)는 쉘에서 메타-문자가 아니고 탈출될 필요가 없습니다.
Inkscape.exe는 기본 출시에서 명령줄 인수를 허용하지 않습니다. 여러분은 inkscapec.exe를 다운로드해야 할 것입니다. 그런-다음 $wgSVGConverters를 다음으로 설정합니다.
$wgSVGConverters = [
'inkscape' => 'inkscapec.exe --file=$input --export-png=$output --export-width=$width --without-gui',
];
inkscapec.exe는 명령줄의 긴 버전과 짧은 버전을 모두 처리합니다.
윈도우-제품군 운영 시스템에서, 느낌표 (!)는 쉘에서 메타-문자가 아니고 탈출될 필요가 없습니다.
Linux
일부 리눅스 설치 (예를 들어, OpenSuSE 10.3, Debian, Ubuntu)에서, rsvg가 이름-변경되었습니다 (그리고 별도로 패키지될 수 있습니다).
$wgSVGConverters = [ 'rsvg' => '/usr/bin/rsvg-convert -w $width -h $height -o $output $input' ];
$wgSVGConverter = 'rsvg' ;
만약 Java 실행 파일이 경로에 없으면, batik을 사용하도록 지정해야 합니다. 그렇지 않으면 "Thumbnail creation failed:" 메시지가 표시됩니다. 예를 들어:
$wgSVGConverters['batik'] = '/usr/local/bin/java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d $output $input';
OpenBSD and FreeBSD
OpenBSD와 FreeBSD 설치에서, rsvg는 rsvg-convert로 이름-변경되었습니다:
$wgSVGConverterPath = "/usr/local/bin";
$wgSVGConverters = [ 'rsvg' => '$path/rsvg-convert -w $width -h $height -o $output $input' ];
$wgSVGConverter = 'rsvg' ;
See also