summaryrefslogtreecommitdiff
path: root/picture.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-05-10 00:09:24 +0800
committerxuri <xuri.me@gmail.com>2021-05-10 00:09:24 +0800
commitbe12cc27f1d774154b17763c071e1dc6f91eab8c (patch)
treed6544c2e33e8aacfb0867e79ffc69fde435d3183 /picture.go
parent423bc26d1f87db55bab5704afebf4509269bbc7e (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.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/picture.go b/picture.go
index de7e0f8..92e0106 100644
--- a/picture.go
+++ b/picture.go
@@ -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 {