mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
24 lines
391 B
Go
24 lines
391 B
Go
package images
|
|
|
|
import (
|
|
"bytes"
|
|
"github.com/chrislusf/seaweedfs/weed/util"
|
|
"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)
|
|
|
|
util.WriteFile("resized1.png", buf.Bytes(), 0644)
|
|
|
|
os.Remove("resized1.png")
|
|
|
|
}
|