chore: Проверки к типам

This commit is contained in:
origami11@yandex.ru 2025-12-01 19:44:22 +03:00
parent 5d3fae4249
commit 8786e84568
12 changed files with 41 additions and 47 deletions

View file

@ -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);