Photos
Blog
Projects
vanrenterghem.biz
projects
/
git.ikiwiki.info.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix misleading comment
[git.ikiwiki.info.git]
/
IkiWiki
/
Plugin
/
img.pm
diff --git
a/IkiWiki/Plugin/img.pm
b/IkiWiki/Plugin/img.pm
index 5c580c03cec01a5c4529fefd9f207702e0306d58..68b001671653000b4907ababf1d63782d834381c 100644
(file)
--- a/
IkiWiki/Plugin/img.pm
+++ b/
IkiWiki/Plugin/img.pm
@@
-43,7
+43,8
@@
sub preprocess (@) {
return '';
}
return '';
}
- push @{$links{$params{page}}}, $image;
+ add_link($params{page}, $image);
+
# optimisation: detect scan mode, and avoid generating the image
if (! defined wantarray) {
return;
# optimisation: detect scan mode, and avoid generating the image
if (! defined wantarray) {
return;
@@
-65,8
+66,10
@@
sub preprocess (@) {
my $r;
if ($params{size} ne 'full') {
my $r;
if ($params{size} ne 'full') {
+ add_depends($params{page}, $image);
+
my ($w, $h) = ($params{size} =~ /^(\d*)x(\d*)$/);
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));
unless (defined $w && defined $h &&
(length $w || length $h));
@@
-102,8
+105,6
@@
sub preprocess (@) {
$imglink = $file;
}
$imglink = $file;
}
- add_depends($imglink, $params{page});
-
my ($fileurl, $imgurl);
if (! $params{preview}) {
$fileurl=urlto($file, $params{destpage});
my ($fileurl, $imgurl);
if (! $params{preview}) {
$fileurl=urlto($file, $params{destpage});
@@
-119,10
+120,11
@@
sub preprocess (@) {
}
my $imgtag='<img src="'.$imgurl.
}
my $imgtag='<img src="'.$imgurl.
- '" alt="'.(exists $params{alt} ? $params{alt} : '').
'" width="'.$im->Get("width").
'" height="'.$im->Get("height").'"'.
'" width="'.$im->Get("width").
'" height="'.$im->Get("height").'"'.
+ (exists $params{alt} ? ' alt="'.$params{alt}.'"' : '').
(exists $params{title} ? ' title="'.$params{title}.'"' : '').
(exists $params{title} ? ' title="'.$params{title}.'"' : '').
+ (exists $params{align} ? ' align="'.$params{align}.'"' : '').
(exists $params{class} ? ' class="'.$params{class}.'"' : '').
(exists $params{id} ? ' id="'.$params{id}.'"' : '').
' />';
(exists $params{class} ? ' class="'.$params{class}.'"' : '').
(exists $params{id} ? ' id="'.$params{id}.'"' : '').
' />';