chore: Проверки к типам
This commit is contained in:
parent
5d3fae4249
commit
8786e84568
12 changed files with 41 additions and 47 deletions
|
|
@ -30,9 +30,8 @@ class Image
|
|||
if ($percent > 1 && !$force) {
|
||||
$percent = 1;
|
||||
}
|
||||
$new_width = $width * $percent;
|
||||
$new_height = $height * $percent;
|
||||
|
||||
$new_width = max(1, (int)($width * $percent));
|
||||
$new_height = max(1, (int)($height * $percent));
|
||||
|
||||
$image_p = imagecreatetruecolor($new_width, $new_height);
|
||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue