summaryrefslogtreecommitdiff
path: root/sheet.go
diff options
context:
space:
mode:
authorRi Xu <xuri.me@gmail.com>2017-03-28 21:18:06 +0800
committerRi Xu <xuri.me@gmail.com>2017-03-28 21:18:06 +0800
commit02b81b7efe58549f88c93c1264ef618ee842c0fc (patch)
tree621aca06fc6cca380fdb8fa2f5241fbc043e26a0 /sheet.go
parent8dcdf9024dda4f31797e8b5b00d198ea905527bf (diff)
- Get an images in a cell supported, new function `GetPicture` added;
- go test updated
Diffstat (limited to 'sheet.go')
-rw-r--r--sheet.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/sheet.go b/sheet.go
index 56a0ba9..aa653f8 100644
--- a/sheet.go
+++ b/sheet.go
@@ -257,13 +257,12 @@ func (f *File) GetSheetMap() map[int]string {
// SetSheetBackground provides function to set background picture by given sheet
// index.
func (f *File) SetSheetBackground(sheet, picture string) error {
- var supportTypes = map[string]string{".gif": ".gif", ".jpg": ".jpeg", ".jpeg": ".jpeg", ".png": ".png"}
var err error
// Check picture exists first.
if _, err = os.Stat(picture); os.IsNotExist(err) {
return err
}
- ext, ok := supportTypes[path.Ext(picture)]
+ ext, ok := supportImageTypes[path.Ext(picture)]
if !ok {
return errors.New("Unsupported image extension")
}