}
add_link($params{page}, $image);
+
# optimisation: detect scan mode, and avoid generating the image
if (! defined wantarray) {
return;
my $r;
if ($params{size} ne 'full') {
+ add_depends($params{page}, $image);
+
my ($w, $h) = ($params{size} =~ /^(\d*)x(\d*)$/);
- error sprintf(gettext('bad size "%s"'), $params{size})
+ error sprintf(gettext('wrong size format "%s" (should be WxH)'), $params{size})
unless (defined $w && defined $h &&
(length $w || length $h));
$imglink = $file;
}
- add_depends($imglink, $params{page});
-
my ($fileurl, $imgurl);
if (! $params{preview}) {
$fileurl=urlto($file, $params{destpage});
my $imgtag='<img src="'.$imgurl.
'" width="'.$im->Get("width").
'" height="'.$im->Get("height").'"'.
- (exists $params{alt} ? '" alt="'.$params{alt}.'"' : '').
+ (exists $params{alt} ? ' alt="'.$params{alt}.'"' : '').
(exists $params{title} ? ' title="'.$params{title}.'"' : '').
+ (exists $params{align} ? ' align="'.$params{align}.'"' : '').
(exists $params{class} ? ' class="'.$params{class}.'"' : '').
(exists $params{id} ? ' id="'.$params{id}.'"' : '').
' />';