嘿伙计们)需要你的帮助。我使用 ext yii2-imagine。我尝试以质量 => 50 保存文件,但它不起作用。图像始终以质量 => 100 保存。为什么会发生这种情况?
$imagine = new Image();
$photo = $imagine::getImagine()->open($this->uploadedFile->tempName);
$width = $photo->getSize()->getWidth();
$height = $photo->getSize()->getHeight();
if (($width >= $this->width) || ($height >= $this->height)) {
$photo->thumbnail(new Box($this->width, $this->height))->save($this->uploadedFile->tempName, ['quality' => 50]);
}