# optimisation: detect scan mode, and avoid generating the image
if (! defined wantarray) {
# optimisation: detect scan mode, and avoid generating the image
if (! defined wantarray) {
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 &&
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 &&
$imgtag=htmllink($params{page}, $params{destpage},
$params{link}, linktext => $imgtag,
noimageinline => 1);
$imgtag=htmllink($params{page}, $params{destpage},
$params{link}, linktext => $imgtag,
noimageinline => 1);