summaryrefslogtreecommitdiff
path: root/picture.go
diff options
context:
space:
mode:
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 {