mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-07 21:48:13 -08:00
Add the option to use background and threshold options on trim
This commit is contained in:
parent
1a5477aae5
commit
58bc9312b6
5 changed files with 42 additions and 5 deletions
|
|
@ -273,7 +273,7 @@ func extractOrEmbedImage(image *C.VipsImage, o Options) (*C.VipsImage, error) {
|
|||
image, err = vipsEmbed(image, left, top, o.Width, o.Height, o.Extend, o.Background)
|
||||
break
|
||||
case o.Trim:
|
||||
left, top, width, height, err := vipsTrim(image)
|
||||
left, top, width, height, err := vipsTrim(image, o.Background, o.Threshold)
|
||||
if err == nil {
|
||||
image, err = vipsExtract(image, left, top, width, height)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue