diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-01-09 02:31:11 -0500 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-01-09 02:31:11 -0500 |
commit | a654a72fda2be74857a9b8074eb0c2f944907b69 (patch) | |
tree | f79941f81dc9c4724edf892fee04bdd4a7126250 /IkiWiki/Plugin | |
parent | 50faf0b151e08887b686e88d525b3b3e3b5379e5 (diff) | |
download | ikiwiki-a654a72fda2be74857a9b8074eb0c2f944907b69.tar ikiwiki-a654a72fda2be74857a9b8074eb0c2f944907b69.tar.gz |
optimisation: detect scan mode and avoid generating image
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/img.pm | 5 |
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}; |