From: Joey Hess Date: Wed, 9 Jan 2008 07:31:11 +0000 (-0500) Subject: optimisation: detect scan mode and avoid generating image X-Git-Tag: 2.20~19 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/a654a72fda2be74857a9b8074eb0c2f944907b69 optimisation: detect scan mode and avoid generating image --- diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index 88a3d7b4d..b6e7c9e41 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -32,6 +32,11 @@ sub preprocess (@) { #{{{ } push @{$links{$params{page}}}, $image; + # optimisation: detect scan mode, and avoid generating the image + if (! defined wantarray) { + return; + } + my $file = bestlink($params{page}, $image); my $dir = $params{page};