mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-07 21:48:13 -08:00
feat(#92): support Extend param with optional background
This commit is contained in:
parent
44636a88f0
commit
522cf71c73
6 changed files with 73 additions and 7 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue