mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-15 02:15:54 -07:00
refactor: crop and tests
This commit is contained in:
parent
b20ddbb8f3
commit
2e90c11e5b
3 changed files with 45 additions and 8 deletions
9
image.go
9
image.go
|
|
@ -22,6 +22,15 @@ func (i *Image) Extract(top int, left int, width int, height int) ([]byte, error
|
|||
return i.Process(options)
|
||||
}
|
||||
|
||||
func (i *Image) Crop(width int, height int) ([]byte, error) {
|
||||
options := Options{
|
||||
Width: width,
|
||||
Height: height,
|
||||
Crop: true,
|
||||
}
|
||||
return i.Process(options)
|
||||
}
|
||||
|
||||
func (i *Image) Rotate(a Angle) ([]byte, error) {
|
||||
options := Options{Rotate: a}
|
||||
return i.Process(options)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue