diff options
author | chrysn <chrysn@fsfe.org> | 2014-04-07 11:19:04 +0200 |
---|---|---|
committer | chrysn <chrysn@fsfe.org> | 2014-04-07 11:19:04 +0200 |
commit | 6cc43773e728df783e29389680e6bf50d3ef6592 (patch) | |
tree | 46b820d561d9f51d21b67e5747505cfbc982e3c7 /IkiWiki/Plugin/img.pm | |
parent | 71b9ad33e04bd131e1d46cf0857ff83ed7407ba3 (diff) | |
download | ikiwiki-6cc43773e728df783e29389680e6bf50d3ef6592.tar ikiwiki-6cc43773e728df783e29389680e6bf50d3ef6592.tar.gz |
add pdf support to the img directive
this is trivial as pdf is supported by imagemagick, and just needs an
explicit mention to enable conversion.
Diffstat (limited to 'IkiWiki/Plugin/img.pm')
-rw-r--r-- | IkiWiki/Plugin/img.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index c861d7075..ae681f9e6 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -65,6 +65,7 @@ sub preprocess (@) { my $dir = $params{page}; my $base = IkiWiki::basename($file); my $issvg = $base=~s/\.svg$/.png/i; + my $ispdf = $base=~s/\.pdf$/.png/i; eval q{use Image::Magick}; error gettext("Image::Magick is not installed") if $@; @@ -124,7 +125,7 @@ sub preprocess (@) { # don't actually write resized file in preview mode; # rely on width and height settings if (! $params{preview}) { - $im->set($issvg ? (magick => 'png') : ()); + $im->set(($issvg || $ispdf) ? (magick => 'png') : ()); my @blob = $im->ImageToBlob(); writefile($imglink, $config{destdir}, $blob[0], 1); } |