mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-17 19:26:35 -07:00
Adding trim operation.
Closes #22 Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
This commit is contained in:
parent
b35675c245
commit
c1f2667c0f
8 changed files with 64 additions and 5 deletions
7
image.go
7
image.go
|
|
@ -178,6 +178,13 @@ func (i *Image) Colourspace(c Interpretation) ([]byte, error) {
|
|||
return i.Process(options)
|
||||
}
|
||||
|
||||
// Trim removes the background from the picture. It can result in a 0x0 output
|
||||
// if the image is all background.
|
||||
func (i *Image) Trim() ([]byte, error) {
|
||||
options := Options{Trim: true}
|
||||
return i.Process(options)
|
||||
}
|
||||
|
||||
// Process processes the image based on the given transformation options,
|
||||
// talking with libvips bindings accordingly and returning the resultant
|
||||
// image buffer.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue