मैन्युअल:$wgSVGConverters

From mediawiki.org
This page is a translated version of the page Manual:$wgSVGConverters and the translation is 100% complete.
SVG: $wgSVGConverters
स्केलेबल वेक्टर ग्राफिक्स (SVG) कन्वर्टर्स के पथों की सूची।
Introduced in version:1.4.0
Removed in version:still in use
Allowed values:(ऐरे) नीचे देखें
Default value:नीचे देखें

विस्तार

स्केलेबल वेक्टर ग्राफिक्स (SVG) को चित्रों के रूप में अपलोड किया जा सकता है। हालाँकि, कुछ ब्राउज़रों में SVG का समर्थन नहीं है - विशेष रूप से, संस्करण 9 से पहले इंटरनेट एक्सप्लोरर SVG प्रारूप दिखा नहीं पता था।

इसलिए, फ़ॉलबैक के रूप में SVG प्रारूप के चित्रों को PNG प्रारूप में बदल लेना आवश्यक है। इस रूपांतरण को करने के लिए एक बाहरी प्रोग्राम की आवश्यकता है।

इस ऐरे में SVG रूपांतरण प्रोग्रामों की सूची और हर प्रोग्राम के लिए एक कमांड पंक्ति है। अपने सिस्टम पर किस प्रोग्राम का उपयोग करना है, यह चुनने के लिए $wgSVGConverter वेरिएबल सेट करें।

डिफ़ॉल्ट वैल्यू

मीडियाविकि संस्करण:
1.39
$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 -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-convert -w $width -h $height -o $output $input',
	'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
	'ImagickExt' => [ 'SvgHandler::rasterizeImagickExt', ],
];
मीडियाविकि संस्करण:
1.25 – 1.38
$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 -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-convert -w $width -h $height -o $output $input',
	'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
	'ImagickExt' => [ 'SvgHandler::rasterizeImagickExt' ],
];
मीडियाविकि संस्करण:
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 -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',
	'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
	'ImagickExt' => array( 'SvgHandler::rasterizeImagickExt' ),
);
मीडियाविकि संस्करण:
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 -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',
	'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
	'ImagickExt' => array( 'SvgHandler::rasterizeImagickExt' ),
);
मीडियाविकि संस्करण:
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 -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',
	'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
	'ImagickExt' => array( 'SvgHandler::rasterizeImagickExt' ),
	);
मीडियाविकि संस्करण:
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 -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',
	'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
	);
मीडियाविकि संस्करण:
1.13

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 -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',
	'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
	);
मीडियाविकि संस्करण:
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 -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',
	);
मीडियाविकि संस्करण:
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 -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',
	);
मीडियाविकि संस्करण:
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 -z -w $width -f $input -e $output',
	'batik' => 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d $output $input',
	);

उपयोग

निम्न वेरिएबलों को कमांड पंक्ति में निर्दिष्ट किया जा सकता है:

  • $path - $wgSVGConverterPath का वैल्यू, अगर सेट किया जाएगा; वरना $path/ (स्लैश पर गौर करें) को हटा दिया जाएगा
  • $input - इनपुट किए गए SVG फ़ाइल के लिए पथ
  • $output - वह पथ जहाँ मीडियाविकि आउटपुट PNG फ़ाइल की तलाश करेगा
  • $width - उचित चौड़ाई
  • $height - उचित ऊँचाई
विस्मयादिबोधक चिह्न '(!)' यूनिक्स शेल में एक मेटा-अक्षर है और इसे बैकस्लैश से एस्केप करना पड़ता है। उपरोक्त कोड नमूने में, यह ImageMagick के लिए कमांड में देखा जा सकता है। Windows-पारिवारिक ऑपरेटिंग सिस्टम्स पर, विस्मयादिबोधक चिह्न (!) शेल में मेटा-अक्षर नहीं है और इसे एस्केप करने की आवश्यकता नहीं है।

उदाहरण

एक काल्पनिक उदाहरण, जिसमें मान लिया गया है कि mysvg2png नामक एक एक्सेक्यूटेबल, सिस्टम पथ पर है:

$wgSVGConverters = [
	'mysvg2png' => '$path/mysvg2png -input $input -toFormat PNG -w $width -h $height -output $output'
];
$wgSVGConverter = 'mysvg2png';

मंच-विशिष्ट टिप्पणियाँ

Windows

Windows पर, जहाँ एक्सेक्यूटेबल पथ में रिक्त स्थान हो सकते हैं, आपको एक्सेक्यूटेबल के नाम को उद्धरण चिह्नों में लपेटना पड़ सकता है। उदाहरणस्वरूप:

$wgSVGConverters = [
    'inkscape' => '"$path/Inkscape/inkscape" -z -w $width -f $input -e $output',
];

Windows-पारिवारिक ऑपरेटिंग सिस्टम्स पर, विस्मयादिबोधक चिह्न (!) शेल में मेटा-अक्षर नहीं है और इसे एस्केप करने की आवश्यकता नहीं है।

Inkscape.exe डिफ़ॉल्ट प्रकाशन में कमांड पंक्ति तर्क स्वीकार नहीं करता है। आपको inkscapec.exe डाउनलोड करना होगा। फिर $wgSVकन्वर्टर्स को निम्नलिखित में सेट करें।

$wgSVGConverters = [
    'inkscape' => 'inkscapec.exe --file=$input --export-png=$output --export-width=$width --without-gui',
];

inkscapec.exe कमांड-पंक्ति के लंबे और छोटे, दोनों संस्करणों को समर्थित करता है।

Windows-पारिवारिक ऑपरेटिंग सिस्टम्स पर, विस्मयादिबोधक चिह्न (!) शेल में मेटा-अक्षर नहीं है और इसे एस्केप करने की आवश्यकता नहीं है।

लिनक्स

कुछ लिनक्स स्थापनाओं (जैसे OpenSuSE 10.3, Debian, Ubuntu) पर rsvg का नाम बदल दिया जाता है (और शायद इसे अलग से पैकेज किया जाए):

$wgSVGConverters = [ 'rsvg' => '/usr/bin/rsvg-convert -w $width -h $height -o $output $input' ];
$wgSVGConverter = 'rsvg' ;

अगर जावा एक्सेक्यूटेबल, पथ पर नहीं है, इसे Batik का इस्तेमाल करने के लिए निर्दिष्ट करना पड़ेगा, वरना "अंगूठाकार बनाने में असफल:" का एक संदेश दिखाया जाएगा। उदाहरणस्वरूप:

$wgSVGConverters['batik'] = '/usr/local/bin/java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d $output $input';
विस्मयादिबोधक चिह्न '(!)' यूनिक्स शेल में एक मेटा-अक्षर है और इसे बैकस्लैश से एस्केप करना पड़ता है।

OpenBSD और FreeBSD

OpenBSD और FreeBSD स्थापनाओं पर rsvg का नाम rsvg-convert में बदल दिया गया है:

$wgSVGConverterPath = "/usr/local/bin";
$wgSVGConverters = [ 'rsvg' => '$path/rsvg-convert -w $width -h $height -o $output $input' ];
$wgSVGConverter = 'rsvg' ;

ये भी देखें