mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-07 21:48:13 -08:00
20 lines
319 B
Go
20 lines
319 B
Go
package bimg
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"os"
|
|
"path"
|
|
"testing"
|
|
)
|
|
|
|
func TestImageResize(t *testing.T) {
|
|
data, _ := os.Open(path.Join("fixtures/test.jpg"))
|
|
buf, err := ioutil.ReadAll(data)
|
|
|
|
image := NewImage(buf)
|
|
|
|
buf, err = image.Resize(300, 240)
|
|
if err != nil {
|
|
t.Errorf("Cannot process the image: %#v", err)
|
|
}
|
|
}
|