refactor(resize): extract

This commit is contained in:
Tomas Aparicio 2015-04-06 23:43:30 +02:00
parent d9eac32a9a
commit 3904953399
9 changed files with 246 additions and 173 deletions

View file

@ -19,3 +19,20 @@ func TestRead(t *testing.T) {
t.Fatal("Image is not jpeg")
}
}
func TestWrite(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")
}
err = Write("fixtures/test_write_out.jpg", buf)
if err != nil {
t.Fatal("Cannot write the file: %#v", err)
}
}