From 1aed1d744b12885c4a88c090494175c59208e038 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 25 Feb 2019 22:14:34 +0800 Subject: Resolve #274, performance optimization for add images, charts and shapes --- excelize_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'excelize_test.go') 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) { -- cgit v1.2.1