refactor(#55): minor changes, use proper declarations, unref image

This commit is contained in:
Tomas Aparicio 2015-09-29 08:45:02 +01:00
parent e83c80c93c
commit 174de89a40
5 changed files with 41 additions and 20 deletions

View file

@ -4,6 +4,11 @@ type Image struct {
buffer []byte
}
// Creates a new image
func NewImage(buf []byte) *Image {
return &Image{buf}
}
// Resize the image to fixed width and height
func (i *Image) Resize(width, height int) ([]byte, error) {
options := Options{
@ -190,8 +195,3 @@ func (i *Image) Size() (ImageSize, error) {
func (i *Image) Image() []byte {
return i.buffer
}
// Creates a new image
func NewImage(buf []byte) *Image {
return &Image{buf}
}