summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/img.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-09-09 15:20:06 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-09-09 15:20:06 -0400
commit5d53fab853def09bcc2c7455cabdbc9a002746e2 (patch)
tree3583b9d1985721501fd7018fe72c7b4652acbbd8 /IkiWiki/Plugin/img.pm
parent7a680431edd837809cd62666ead08944ddc5658c (diff)
img: Support sizes like 200x. Closes: #475149
Diffstat (limited to 'IkiWiki/Plugin/img.pm')
-rw-r--r--IkiWiki/Plugin/img.pm5
1 files changed, 3 insertions, 2 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";