mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-15 18:35:54 -07:00
Add Image.Length()
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
This commit is contained in:
parent
75a5d927d3
commit
a792146837
2 changed files with 17 additions and 1 deletions
|
|
@ -475,6 +475,17 @@ func TestImageSmartCrop(t *testing.T) {
|
|||
Write("fixtures/test_smart_crop.jpg", buf)
|
||||
}
|
||||
|
||||
func TestImageLength(t *testing.T) {
|
||||
i := initImage("test.jpg")
|
||||
|
||||
actual := i.Length()
|
||||
expected := 53653
|
||||
|
||||
if expected != actual {
|
||||
t.Errorf("Size in Bytes of the image doesn't correspond. %d != %d", expected, actual)
|
||||
}
|
||||
}
|
||||
|
||||
func initImage(file string) *Image {
|
||||
buf, _ := imageBuf(file)
|
||||
return NewImage(buf)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue