diff options
author | xuri <xuri.me@gmail.com> | 2021-05-10 00:09:24 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-05-10 00:09:24 +0800 |
commit | be12cc27f1d774154b17763c071e1dc6f91eab8c (patch) | |
tree | d6544c2e33e8aacfb0867e79ffc69fde435d3183 /picture.go | |
parent | 423bc26d1f87db55bab5704afebf4509269bbc7e (diff) |
This closes #652, new SetColWidth API, support set column width in stream writing mode, and export error message
Diffstat (limited to 'picture.go')
-rw-r--r-- | picture.go | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -15,7 +15,6 @@ import ( "bytes" "encoding/json" "encoding/xml" - "errors" "fmt" "image" "io" @@ -93,7 +92,7 @@ func (f *File) AddPicture(sheet, cell, picture, format string) error { } ext, ok := supportImageTypes[path.Ext(picture)] if !ok { - return errors.New("unsupported image extension") + return ErrImgExt } file, _ := ioutil.ReadFile(picture) _, name := filepath.Split(picture) @@ -134,7 +133,7 @@ func (f *File) AddPictureFromBytes(sheet, cell, format, name, extension string, var hyperlinkType string ext, ok := supportImageTypes[extension] if !ok { - return errors.New("unsupported image extension") + return ErrImgExt } formatSet, err := parseFormatPictureSet(format) if err != nil { |