Skip to content

Commit

Permalink
修正png质量 最大不超过9
Browse files Browse the repository at this point in the history
  • Loading branch information
yunwuxin committed Jul 20, 2016
1 parent b45055c commit a708d93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function save($pathname, $type = null, $quality = 80, $interlace = true)
//设定保存完整的 alpha 通道信息
imagesavealpha($this->im, true);
//ImagePNG生成图像的质量范围从0到9的
imagepng($this->im, $pathname, max((int)($quality / 10), 9));
imagepng($this->im, $pathname, min((int)($quality / 10), 9));
} else {
$fun = 'image' . $type;
$fun($this->im, $pathname);
Expand Down

0 comments on commit a708d93

Please sign in to comment.