有没有人有这方面的工作?我认为图像已经被优化了。然后它被调整大小,并且尽管图片被缩小了,但它还是放弃了优化。文件大小增加。PHP - 调整大小的图像有较大的文件大小
有没有人遇到过这个。
我有一个保存在50%质量的图像。如果我复制 - >调整大小 - >保存在70%,它获得80Kb ..
有没有一种解决方案,使我能够检测图像质量之前,它?
function resize($width,$height) {
$new_image = imagecreatetruecolor($width, $height);
imagesavealpha($new_image, true);
$trans_colour = imagecolorallocatealpha($new_image, 0, 0, 0, 127);
imagefill($new_image, 0, 0, $trans_colour);
imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());
$this->image = $new_image;
}
...
imagejpeg($this->image,$filename,$compression);
Pelle ten Cate,[在superuser.com上](http://superuser.com/questions/62730/how-to-find-the-jpg-quality/62734#62734)表明ImageMagick可以确定质量即使文件没有EXIF数据保存。 – binaryLV