You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
391 B

  1. package images
  2. import (
  3. "bytes"
  4. "github.com/chrislusf/seaweedfs/weed/util"
  5. "os"
  6. "testing"
  7. )
  8. func TestResizing(t *testing.T) {
  9. fname := "sample2.webp"
  10. dat, _ := os.ReadFile(fname)
  11. resized, _, _ := Resized(".webp", bytes.NewReader(dat), 100, 30, "")
  12. buf := new(bytes.Buffer)
  13. buf.ReadFrom(resized)
  14. util.WriteFile("resized1.png", buf.Bytes(), 0644)
  15. os.Remove("resized1.png")
  16. }