mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-13 01:10: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
5
image.go
5
image.go
|
|
@ -48,6 +48,11 @@ func (i *Image) Extract(top, left, width, height int) ([]byte, error) {
|
|||
AreaWidth: width,
|
||||
AreaHeight: height,
|
||||
}
|
||||
|
||||
if top == 0 && left == 0 {
|
||||
options.Top = -1
|
||||
}
|
||||
|
||||
return i.Process(options)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue