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.
21 lines
386 B
21 lines
386 B
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)
|
|
}
|
|
}
|