ソースを参照

Always flatten if the resulting format does not support alpha

DarthSim 5 年 前
コミット
98ee337b00
1 ファイル変更1 行追加1 行削除
  1. 1 1
      process.go

+ 1 - 1
process.go

@@ -432,7 +432,7 @@ func transformImage(ctx context.Context, img *vipsImage, data []byte, po *proces
 
 	transparrentBg := po.Format.SupportsAlpha() && !po.Flatten
 
-	if hasAlpha && (po.Flatten || po.Format == imageTypeJPEG) {
+	if hasAlpha && !transparrentBg {
 		if err = img.Flatten(po.Background); err != nil {
 			return err
 		}