Update Image.php

This commit is contained in:
Visman 2023-03-30 23:24:48 +07:00
parent b2732cb847
commit 1528ee4f07

View file

@ -73,6 +73,23 @@ class Image extends File
return $this;
}
/**
* Проверяет и устанавливает качество для сохраняемого изображения
*/
public function setQuality(int $quality): Image
{
if (
$quality < 0
|| $quality > 100
) {
throw new InvalidArgumentException('Invalid image quality value: ' . $quality);
}
$this->quality = $quality;
return $this;
}
/**
* Возвращает информацию о пути к сохраняемой картинке с учетом подстановок
*/