diff options
author | Ri Xu <xuri.me@gmail.com> | 2017-03-28 21:18:06 +0800 |
---|---|---|
committer | Ri Xu <xuri.me@gmail.com> | 2017-03-28 21:18:06 +0800 |
commit | 02b81b7efe58549f88c93c1264ef618ee842c0fc (patch) | |
tree | 621aca06fc6cca380fdb8fa2f5241fbc043e26a0 /sheet.go | |
parent | 8dcdf9024dda4f31797e8b5b00d198ea905527bf (diff) |
- Get an images in a cell supported, new function `GetPicture` added;
- go test updated
Diffstat (limited to 'sheet.go')
-rw-r--r-- | sheet.go | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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") } |