mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-02-02 11:34:20 +02:00
Flatten image with alpha when saving to jpeg; Make white default background
This commit is contained in:
parent
431dad235c
commit
7ac390621d
@ -336,7 +336,7 @@ func transformImage(ctx context.Context, img **C.struct__VipsImage, data []byte,
|
|||||||
checkTimeout(ctx)
|
checkTimeout(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
if hasAlpha && po.Flatten {
|
if hasAlpha && (po.Flatten || po.Format == imageTypeJPEG) {
|
||||||
if err = vipsFlatten(img, po.Background); err != nil {
|
if err = vipsFlatten(img, po.Background); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -702,6 +702,7 @@ func defaultProcessingOptions(headers *processingHeaders) (*processingOptions, e
|
|||||||
Enlarge: false,
|
Enlarge: false,
|
||||||
Quality: conf.Quality,
|
Quality: conf.Quality,
|
||||||
Format: imageTypeUnknown,
|
Format: imageTypeUnknown,
|
||||||
|
Background: color{255, 255, 255},
|
||||||
Blur: 0,
|
Blur: 0,
|
||||||
Sharpen: 0,
|
Sharpen: 0,
|
||||||
Watermark: watermarkOptions{Opacity: 1, Replicate: false, Gravity: gravityCenter},
|
Watermark: watermarkOptions{Opacity: 1, Replicate: false, Gravity: gravityCenter},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user