mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-07 21:48:13 -08:00
refactor(resize): extract
This commit is contained in:
parent
d9eac32a9a
commit
3904953399
9 changed files with 246 additions and 173 deletions
17
file_test.go
17
file_test.go
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue