summaryrefslogtreecommitdiff
path: root/picture.go
diff options
context:
space:
mode:
Diffstat (limited to 'picture.go')
-rw-r--r--picture.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/picture.go b/picture.go
index d039ae0..97e72a6 100644
--- a/picture.go
+++ b/picture.go
@@ -88,7 +88,11 @@ func (f *File) AddPicture(sheet, cell, picture, format string) error {
if !ok {
return errors.New("Unsupported image extension")
}
- readFile, _ := os.Open(picture)
+ readFile, err := os.Open(picture)
+ if err!=nil{
+ return err
+ }
+ defer readFile.Close()
image, _, _ := image.DecodeConfig(readFile)
_, file := filepath.Split(picture)
formatSet, err := parseFormatPictureSet(format)