From ad7f767e6ab4dc490c20122c832a5a0633da681b Mon Sep 17 00:00:00 2001 From: Tomas Aparicio Date: Tue, 7 Apr 2015 12:15:58 +0200 Subject: [PATCH] fix(extract): detect area options --- resize.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resize.go b/resize.go index 89b963e..c3c0c0e 100644 --- a/resize.go +++ b/resize.go @@ -143,7 +143,7 @@ func extractImage(image *C.struct__VipsImage, o Options) (*C.struct__VipsImage, left, top := (o.Width-inWidth)/2, (o.Height-inHeight)/2 image, err = vipsEmbed(image, left, top, o.Width, o.Height, o.Extend) break - case o.Top > 0 && o.Left > 0: + case o.Top > 0 || o.Left > 0: if o.AreaWidth == 0 || o.AreaHeight == 0 { err = errors.New(fmt.Sprintf("Invalid area to extract %dx%d", o.AreaWidth, o.AreaHeight)) } else {