Subject: | int() to sprintf() |
You should replace this:
$height = int($self->height * $k);
$width = int($self->width * $k);
on this:
$height = sprintf("%.0f", $self->height * $k);
$width = sprintf("%.0f", $self->width * $k);
Because sometimes int() make 99, when 100 needed.