summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/img.pm5
-rw-r--r--debian/changelog1
-rw-r--r--doc/plugins/img.mdwn4
3 files changed, 7 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm
index 66cc08530..7b89ab673 100644
--- a/IkiWiki/Plugin/img.pm
+++ b/IkiWiki/Plugin/img.pm
@@ -65,9 +65,10 @@ sub preprocess (@) { #{{{
my $r;
if ($params{size} ne 'full') {
- my ($w, $h) = ($params{size} =~ /^(\d+)x(\d+)$/);
+ my ($w, $h) = ($params{size} =~ /^(\d*)x(\d*)$/);
error sprintf(gettext('bad size "%s"'), $params{size})
- unless (defined $w && defined $h);
+ unless (defined $w && defined $h &&
+ (length $w || length $h));
my $outfile = "$config{destdir}/$dir/${w}x${h}-$base";
$imglink = "$dir/${w}x${h}-$base";
diff --git a/debian/changelog b/debian/changelog
index 8df8e9f9d..dd0bed151 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ ikiwiki (2.64) UNRELEASED; urgency=low
* ddate: Stop clobbering timeformat when not enabled.
* progress: New plugin to generate progress bars (willu)
* Add allow_symlinks_before_srcdir to config so websetup doesn't eat it.
+ * img: Support sizes like 200x. Closes: #475149
-- Joey Hess <joeyh@debian.org> Mon, 08 Sep 2008 19:21:20 -0400
diff --git a/doc/plugins/img.mdwn b/doc/plugins/img.mdwn
index 898609a29..6da80b7e7 100644
--- a/doc/plugins/img.mdwn
+++ b/doc/plugins/img.mdwn
@@ -21,7 +21,9 @@ the file pointed to by a [[ikiwiki/WikiLink]].
The `size` parameter is optional, defaulting to full size. Note that the
original image's aspect ratio is always preserved, even if this means
-making the image smaller than the specified size.
+making the image smaller than the specified size. You can also specify only
+the width or the height, and the other value will be calculated based on
+it: "200x", "x200".
You can also pass `alt`, `title`, `class` and `id` parameters. These are
passed through unchanged to the html img tag. If you include a `caption`