diff options
author | Simon McVittie <smcv@debian.org> | 2015-06-13 20:00:08 +0100 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2015-06-13 20:00:08 +0100 |
commit | 7a2117bf8c2cf5372e64ab7b368803eec7e6f5d7 (patch) | |
tree | 7b1679110dcc581c62dda475a7a98ccd3ab0f7b0 /IkiWiki | |
parent | f2365c3e660fe0b00a051ce893cdcad0016e560e (diff) | |
download | ikiwiki-7a2117bf8c2cf5372e64ab7b368803eec7e6f5d7.tar ikiwiki-7a2117bf8c2cf5372e64ab7b368803eec7e6f5d7.tar.gz |
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.
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/img.pm | 2 |
1 files changed, 1 insertions, 1 deletions
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")) { |