Skip to content

Commit

Permalink
fix(extract): detect area options
Browse files Browse the repository at this point in the history
  • Loading branch information
h2non committed Apr 7, 2015
1 parent 7e58e95 commit ad7f767
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resize.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ad7f767

Please sign in to comment.