refactor: crop and tests

This commit is contained in:
Tomas Aparicio 2015-04-06 02:21:08 +02:00
parent b20ddbb8f3
commit 2e90c11e5b
3 changed files with 45 additions and 8 deletions

View file

@ -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)