- my ($w, $h) = ($params{size} =~ /^(\d+)x(\d+)$/);
- return "[[img ".sprintf(gettext('bad size "%s"'), $params{size})."]]"
- unless (defined $w && defined $h);
+ my ($w, $h) = ($params{size} =~ /^(\d*)x(\d*)$/);
+ error sprintf(gettext('wrong size format "%s" (should be WxH)'), $params{size})
+ unless (defined $w && defined $h &&
+ (length $w || length $h));