feat(#92): support Extend param with optional background

This commit is contained in:
Tomas Aparicio 2016-09-30 22:56:59 +01:00
parent 44636a88f0
commit 522cf71c73
6 changed files with 73 additions and 7 deletions

View file

@ -240,7 +240,7 @@ func extractOrEmbedImage(image *C.VipsImage, o Options) (*C.VipsImage, error) {
break
case o.Embed:
left, top := (o.Width-inWidth)/2, (o.Height-inHeight)/2
image, err = vipsEmbed(image, left, top, o.Width, o.Height, o.Extend)
image, err = vipsEmbed(image, left, top, o.Width, o.Height, o.Extend, o.Background)
break
case o.Top != 0 || o.Left != 0:
if o.AreaWidth == 0 {