X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/b23ddf6c4a955dc4da8266880d27e25073ee7e06..46c2d66fd37b12c2d02466118cb206000174f1b4:/IkiWiki/Plugin/img.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index 44d67bd83..68b001671 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -44,6 +44,7 @@ sub preprocess (@) { } add_link($params{page}, $image); + # optimisation: detect scan mode, and avoid generating the image if (! defined wantarray) { return; @@ -65,6 +66,8 @@ sub preprocess (@) { my $r; if ($params{size} ne 'full') { + add_depends($params{page}, $image); + my ($w, $h) = ($params{size} =~ /^(\d*)x(\d*)$/); error sprintf(gettext('wrong size format "%s" (should be WxH)'), $params{size}) unless (defined $w && defined $h && @@ -102,8 +105,6 @@ sub preprocess (@) { $imglink = $file; } - add_depends($imglink, $params{page}); - my ($fileurl, $imgurl); if (! $params{preview}) { $fileurl=urlto($file, $params{destpage});