Add the option to use background and threshold options on trim

This commit is contained in:
Martti Leppänen 2017-11-09 15:32:58 -05:00
parent 1a5477aae5
commit 58bc9312b6
5 changed files with 42 additions and 5 deletions

View file

@ -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)
}