mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-13 09:20:29 -07:00
feat(#60): support zero top and left params in extract operation
This commit is contained in:
parent
89292e7ead
commit
b7eaa00f10
4 changed files with 26 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue