From 7a2117bf8c2cf5372e64ab7b368803eec7e6f5d7 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 13 Jun 2015 20:00:08 +0100 Subject: img: stop ImageMagick trying to be clever if filenames contain a colon $im->Read() takes a filename-like argument with several sets of special syntax. Most of the possible metacharacters are escaped by the default `wiki_file_chars` (and in any case not particularly disruptive), but the colon ":" is not. It seems the way to force ImageMagick to treat colons within the filename as literal is to prepend a colon, so do that. --- IkiWiki/Plugin/img.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index 17a58ca7a..169f5e713 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -76,7 +76,7 @@ sub preprocess (@) { my $im = Image::Magick->new(); my $imglink; my $imgdatalink; - my $r = $im->Read("$srcfile\[$pagenumber]"); + my $r = $im->Read(":$srcfile\[$pagenumber]"); error sprintf(gettext("failed to read %s: %s"), $file, $r) if $r; if (! defined $im->Get("width") || ! defined $im->Get("height")) { -- cgit v1.2.3