feat(#60): support zero top and left params in extract operation

This commit is contained in:
Tomas Aparicio 2015-10-12 21:36:37 +01:00
parent 89292e7ead
commit b7eaa00f10
4 changed files with 26 additions and 1 deletions

View file

@ -229,7 +229,7 @@ func extractOrEmbedImage(image *C.VipsImage, o Options) (*C.VipsImage, error) {
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 = o.Width
}