1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-01-08 10:45:04 +02:00

Always flatten if the resulting format does not support alpha

This commit is contained in:
DarthSim 2020-08-21 18:34:33 +06:00
parent 965cd68ecf
commit 98ee337b00

View File

@ -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
}