mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-29 14:31:30 +08:00
a23bcbb7ec
The io/ioutil package has been deprecated as of Go 1.16, see https://golang.org/doc/go1.16#ioutil. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
23 lines
345 B
Go
23 lines
345 B
Go
package images
|
|
|
|
import (
|
|
"bytes"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestResizing(t *testing.T) {
|
|
fname := "sample2.webp"
|
|
|
|
dat, _ := os.ReadFile(fname)
|
|
|
|
resized, _, _ := Resized(".webp", bytes.NewReader(dat), 100, 30, "")
|
|
buf := new(bytes.Buffer)
|
|
buf.ReadFrom(resized)
|
|
|
|
os.WriteFile("resized1.png", buf.Bytes(), 0644)
|
|
|
|
os.Remove("resized1.png")
|
|
|
|
}
|