Update Image.php
This commit is contained in:
parent
b2732cb847
commit
1528ee4f07
1 changed files with 17 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает информацию о пути к сохраняемой картинке с учетом подстановок
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue