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.

22 lines
298 B

package bimg
import (
"testing"
)
func TestRead(t *testing.T) {
buf, err := Read("fixtures/test.jpg")
if err != nil {
t.Errorf("Cannot read the image: %#v", err)
}
if len(buf) == 0 {
t.Fatal("Empty buffer")
}
if DetermineImageType(buf) != JPEG {
t.Fatal("Image is not jpeg")
}
}