X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/8555d10f6369d78c44cf4677010b7e1260d9f5c0..623ac0db421623ce84cb7c6d8c1f2457378b4775:/IkiWiki/Plugin/img.pm diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index bd527c8c8..b98e843d4 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -64,10 +64,11 @@ sub preprocess (@) { my $dir = $params{page}; my $base = IkiWiki::basename($file); + my $issvg = $base=~s/\.svg$/.png/i; eval q{use Image::Magick}; error gettext("Image::Magick is not installed") if $@; - my $im = Image::Magick->new; + my $im = Image::Magick->new($issvg ? (magick => "png") : ()); my $imglink; my $r = $im->Read($srcfile); error sprintf(gettext("failed to read %s: %s"), $file, $r) if $r; @@ -152,8 +153,8 @@ sub preprocess (@) { $imgurl=urlto($imglink, $params{destpage}); } else { - $fileurl="$config{url}/$file"; - $imgurl="$config{url}/$imglink"; + $fileurl=urlto($file); + $imgurl=urlto($imglink); } if (! exists $params{class}) {