From a654a72fda2be74857a9b8074eb0c2f944907b69 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Jan 2008 02:31:11 -0500 Subject: [PATCH] optimisation: detect scan mode and avoid generating image --- IkiWiki/Plugin/img.pm | 5 +++++ 1 file changed, 5 insertions(+) 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}; -- 2.39.5