method quality documentation in bbn\File\Image
Compresses and sets the image's quality (JPEG image only).
Example
$img = new bbn\File\Image("/home/data/test/image.jpg");
$img->quality(60, 6)->save();
function(int $q = 80, int $comp = 8)
{
if ($this->test()
&& ((strtolower($this->getExtension()) === 'jpg')
|| (strtolower($this->getExtension()) === 'jpeg'))
) {
if (self::isImagick()) {
$this->img->setImageCompression($comp);
$this->img->setImageCompressionQuality($q);
$this->img->stripImage();
}
}
return $this;
}
Compresses and sets the image's quality (JPEG image only). BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions