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";
* 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
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`