]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/img.pm
* Since the CGI had to drop the wiki lock to avoid deadlocking the
[ikiwiki.git] / IkiWiki / Plugin / img.pm
index bde5a3e1ae9ff997385b98751efae28da0768e31..2a6533e39aa357572cdb7cc939667927f3e9e2cd 100644 (file)
@@ -6,9 +6,6 @@ package IkiWiki::Plugin::img;
 use warnings;
 use strict;
 use IkiWiki;
-use Image::Magick;
-
-my $convert = 'convert';
 
 my %imgdefaults;
 
@@ -34,11 +31,14 @@ sub preprocess (@) { #{{{
                return '';
        }
 
+       add_depends($params{page}, $image);
        my $file = bestlink($params{page}, $image) || return "[[img $image not found]]";
-       add_depends($params{page}, $file);
 
        my $dir = IkiWiki::dirname($file);
        my $base = IkiWiki::basename($file);
+
+       eval q{use Image::Magick};
+       error($@) if $@;
        my $im = Image::Magick->new;
        my $imglink;
        my $r;