svgimg plugin by Eric Brison
Provides the possibility to view svg file into your web browser such as png images.
Last updated on 2007-06-07.
Compatible with DokuWiki 2007-06-26 > 2006-11-06.
| Download | plugin-svg.tgz |
|---|
This module is designed to work under many different situations and installation environments. There are only a few true requirements for installation.
It is recommended that PHP 5 or greater be used when running this plugin, however it should work with PHP 4.3.0 and up.
The plugins need inkscape or convert (ImageMagick with svg support) programs.
Inkscape is the default because it does a better conversion than convert.
Simply untar file in lib/plugins directory.
Add the line
svg image/svg+xml
in conf/mime.conf file : to support upload of svg files.
If you use inkscape you need to have gnome-vfs2 installed. You need to create .inkscape and .gnome2 directory in apache home directory and set own for him.
Example : (depend on your distrib) cd /var/www mkdir .inkscape mkdir .gnome2 chown apache: .inkscape .gnome2
To use convert instead :
edit lib/plugins/svgimg/resizeimg.php and comment line $cmd=sprintf(“inkscape .. and uncomment line above $cmd=sprintf(“convert
This plugins lauch a javascript function which search all images in HTML page with svg source. When it found one, it send a conversion with resizeimg.php program. This one send the conversion and store it in cache/svg directory. If it is already in cache the conversion is not done twice.
By default the width of converted image is 100px. You can change the size with the common dokuwiki image syntax
{{start:chat_icon_01.svg|}}
{{start:cleanpalm_teudimundo_01.svg?200|}}
Instead of conf/mime.conf I would use conf/mime.local.conf instead to preserve the mime betweem upgrades. Scott
If you use convert instead of inkscape: There are two lines starting with $cmd=sprintf(“convert . Uncomment the lower line and make sure you comment out the whole command $cmd=sprintf(“inkscape (it's split over three lines):
//$cmd=sprintf("convert -thumbnail %d %s %s",$size,escapeshellarg($source), escapeshellarg($dest));
//$cmd=sprintf("inkscape -z --export-width=%d %s --export-png=%s>/dev/null",
// $size,
// escapeshellarg($source),
// escapeshellarg($dest));
$cmd=sprintf("convert -scale %dx%d $source $dest",$size,$size);
jeje
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported