Skip to content

Commit 977806d

Browse files
authored
Merge pull request top-think#509 from itbdw/patch-1
修复 Imagick 类对渐进处理的 bug,并支持 png 文件
2 parents 42fd2e0 + 6ae8920 commit 977806d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ThinkPHP/Library/Think/Image/Driver/Imagick.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ public function save($imgname, $type = null, $quality = 80, $interlace = true)
8484
$this->img->setImageFormat($type);
8585
}
8686

87-
//JPEG图像设置隔行扫描
88-
if ('jpeg' == $type || 'jpg' == $type) {
89-
$this->img->setImageInterlaceScheme(1);
87+
//JPEG\PNG 图像进行渐进渲染
88+
if ('jpeg' == $type || 'jpg' == $type || 'png' == $type) {
89+
$this->img->setImageInterlaceScheme(\Imagick::INTERLACE_PLANE);
9090
}
9191

9292
// 设置图像质量

0 commit comments

Comments
 (0)