diff options
author | xuri <xuri.me@gmail.com> | 2019-02-25 22:14:34 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2019-02-25 22:14:34 +0800 |
commit | 1aed1d744b12885c4a88c090494175c59208e038 (patch) | |
tree | 36b2f51e17df9dfb30a9466c6dcaa46846a0d589 /excelize_test.go | |
parent | 1427027e38d6db46d441243f00d6989c2f53e7ce (diff) |
Resolve #274, performance optimization for add images, charts and shapes
Diffstat (limited to 'excelize_test.go')
-rw-r--r-- | excelize_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/excelize_test.go b/excelize_test.go index d621b87..ed6f073 100644 --- a/excelize_test.go +++ b/excelize_test.go @@ -817,6 +817,24 @@ func TestGetPicture(t *testing.T) { xlsx.getDrawingRelationships("", "") xlsx.getSheetRelationshipsTargetByID("", "") xlsx.deleteSheetRelationships("", "") + + // Try to get picture from a local storage file. + assert.NoError(t, xlsx.SaveAs(filepath.Join("test", "TestGetPicture.xlsx"))) + xlsx, err = OpenFile(filepath.Join("test", "TestGetPicture.xlsx")) + if !assert.NoError(t, err) { + t.FailNow() + } + file, raw = xlsx.GetPicture("Sheet1", "F21") + if file == "" { + err = ioutil.WriteFile(file, raw, 0644) + if !assert.NoError(t, err) { + t.FailNow() + } + } + + // Try to get picture from a local storage file that doesn't contain an image. + file, raw = xlsx.GetPicture("Sheet1", "F22") + t.Log(file, len(raw)) } func TestSheetVisibility(t *testing.T) { |