- my ($w, $h) = ($params{size} =~ /^(\d+)x(\d+)$/);
- error sprintf(gettext('bad size "%s"'), $params{size})
- unless (defined $w && defined $h);
+ add_depends($params{page}, $image);
+
+ 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));