Sfoglia il codice sorgente

Always flatten if the resulting format does not support alpha

DarthSim 5 anni fa
parent
commit
98ee337b00
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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
 		}