Skip to content

Commit

Permalink
Resizing a width or height < 1 will never work, add max() to correct,…
Browse files Browse the repository at this point in the history
… fixes #3213
  • Loading branch information
Woody Gilk committed Sep 14, 2010
1 parent 3221dbc commit e396a48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions classes/kohana/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ public function resize($width = NULL, $height = NULL, $master = NULL)
break;
}

// Convert the width and height to integers
$width = round($width);
$height = round($height);
// Convert the width and height to integers, minimum value is 1px
$width = max(round($width), 1);
$height = max(round($height), 1);

$this->_do_resize($width, $height);

Expand Down

0 comments on commit e396a48

Please sign in to comment.