summaryrefslogtreecommitdiff
path: root/picture_test.go
blob: 97d3cd9156b61530952b612cc38e621af9d4dad7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package excelize

import (
	"fmt"
	_ "image/png"
	"io/ioutil"
	"testing"
)

func BenchmarkAddPictureFromBytes(b *testing.B) {
	f := NewFile()
	imgFile, err := ioutil.ReadFile("logo.png")
	if err != nil {
		panic("unable to load image for benchmark")
	}
	b.ResetTimer()
	for i := 1; i <= b.N; i++ {
		f.AddPictureFromBytes("Sheet1", fmt.Sprint("A", i), "", "logo", ".png", imgFile)
	}
}