* Correct bug in the img plugin that caused dependencies on images to not

always be tracked correctly.
master
joey 2007-05-23 01:44:11 +00:00
parent 4550b6258b
commit bb0cbecbc3
2 changed files with 18 additions and 4 deletions

View File

@ -31,9 +31,17 @@ sub preprocess (@) { #{{{
return '';
}
add_depends($params{page}, $image);
my $file = bestlink($params{page}, $image)
|| return "[[img ".sprintf(gettext("%s not found"), $image)."]]";
my $file = bestlink($params{page}, $image);
if (! $file) {
# TODO: this may not be right, depending on where the file is
# created in the end
add_depends($params{page}, $image);
return "[[img ".sprintf(gettext("%s not found"), $image)."]]";
}
else {
add_depends($params{page}, $file);
}
my $dir = IkiWiki::dirname($file);
my $base = IkiWiki::basename($file);
@ -93,6 +101,10 @@ sub preprocess (@) { #{{{
$imgurl="$config{url}/$imglink";
}
if (! defined($im->Get("width")) || ! defined($im->Get("height"))) {
return "[[img ".sprintf(gettext("failed to determine size of image %s"), $file)."]]";
}
return '<a href="'.$fileurl.'"><img src="'.$imgurl.
'" alt="'.$alt.'" width="'.$im->Get("width").
'" height="'.$im->Get("height").'" /></a>';

4
debian/changelog vendored
View File

@ -5,8 +5,10 @@ ikiwiki (2.2) UNRELEASED; urgency=low
When aggregating, it does not wait for the lock if it cannot get it, and
instead exits, to prevent aggregating processes from piling up.
* Updated Spanish translation from Victor Moral.
* Correct bug in the img plugin that caused dependencies on images to not
always be tracked correctly.
-- Joey Hess <joeyh@debian.org> Mon, 21 May 2007 13:18:37 -0400
-- Joey Hess <joeyh@debian.org> Tue, 22 May 2007 21:29:13 -0400
ikiwiki (2.1) unstable; urgency=low