Explorar el Código

Always flatten if the resulting format does not support alpha

DarthSim hace 5 años
padre
commit
98ee337b00
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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
 		}