diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-07-27 22:22:26 +0200 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-07-27 22:22:26 +0200 |
commit | 9d96250fc5749611ffb954f746fa02147ed29f39 (patch) | |
tree | 3e3e738178e5d3ebbc57ccd2ef24960cb2425177 /IkiWiki/Plugin | |
parent | 7922eae32792c873159929c7fd05b6969a7144f8 (diff) |
img: Fix adding of dependency from page to the image.
This was impressively broken. add_depends was being called with params
backwards, and on parameter was set to the name of the generated
file, which isn't in the source.
Now updates to images will update the page that contains them, thus
updating them. This is unncessary for fullsize images, so skipped.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/img.pm | 5 |
1 files changed, 3 insertions, 2 deletions
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}); |