Skip to content

Commit 0493131

Browse files
committed
remove alpha channel if present before compositing background blur
1 parent 0bf5e2a commit 0493131

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

processing/padding.go

+7
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ func padding(pctx *pipelineContext, img *vips.Image, po *options.ProcessingOptio
108108
// looks bad.
109109
outputScale *= 1.1
110110

111+
if img.HasAlpha() {
112+
// images need to have the same number of channels before EmbedImage below
113+
if err := img.Flatten(vips.Color{}); err != nil {
114+
return err
115+
}
116+
}
117+
111118
if err := img.OldResize(outputScale, false); err != nil {
112119
return err
113120
}

0 commit comments

Comments
 (0)