Add the webp image type

This commit is contained in:
byunghwa.yun
2021-07-24 14:26:40 +09:00
parent bdb632fa62
commit 2595f269d1
3 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package images
import (
"bytes"
"io/ioutil"
"os"
"testing"
)
func TestResizing(t *testing.T) {
fname := "sample2.webp"
dat, _ := ioutil.ReadFile(fname)
resized, _, _ := Resized(".webp", bytes.NewReader(dat), 100, 30, "")
buf := new(bytes.Buffer)
buf.ReadFrom(resized)
ioutil.WriteFile("resized1.png", buf.Bytes(), 0644)
os.Remove("resized1.png")
}