From be12cc27f1d774154b17763c071e1dc6f91eab8c Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 10 May 2021 00:09:24 +0800 Subject: This closes #652, new SetColWidth API, support set column width in stream writing mode, and export error message --- picture.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'picture.go') 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 { -- cgit v1.2.1