mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-14 18:05:55 -07:00
refactor(#55): minor changes, use proper declarations, unref image
This commit is contained in:
parent
e83c80c93c
commit
174de89a40
5 changed files with 41 additions and 20 deletions
10
image.go
10
image.go
|
|
@ -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}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue