aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-01-09 02:31:11 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-01-09 02:31:11 -0500
commita654a72fda2be74857a9b8074eb0c2f944907b69 (patch)
treef79941f81dc9c4724edf892fee04bdd4a7126250 /IkiWiki
parent50faf0b151e08887b686e88d525b3b3e3b5379e5 (diff)
downloadikiwiki-a654a72fda2be74857a9b8074eb0c2f944907b69.tar
ikiwiki-a654a72fda2be74857a9b8074eb0c2f944907b69.tar.gz
optimisation: detect scan mode and avoid generating image
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/img.pm5
1 files changed, 5 insertions, 0 deletions
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};